summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-01-01 02:08:41 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-01-01 02:08:41 +0900
commit88e4f1b287e9fa6be12b5a2277073265d6732527 (patch)
treee57d73ac9c20358f58c679ae57937c6b0c2e77cc
parentUpdate dependencies :rocket: (diff)
downloadmisskey-88e4f1b287e9fa6be12b5a2277073265d6732527.tar.gz
misskey-88e4f1b287e9fa6be12b5a2277073265d6732527.tar.bz2
misskey-88e4f1b287e9fa6be12b5a2277073265d6732527.zip
:v:
-rw-r--r--src/common/build/license.ts13
-rw-r--r--src/web/docs/license.en.pug3
-rw-r--r--src/web/docs/license.ja.pug3
-rw-r--r--src/web/docs/vars.ts3
-rw-r--r--webpack/module/rules/license.ts9
5 files changed, 24 insertions, 7 deletions
diff --git a/src/common/build/license.ts b/src/common/build/license.ts
new file mode 100644
index 0000000000..e5c264df8a
--- /dev/null
+++ b/src/common/build/license.ts
@@ -0,0 +1,13 @@
+import * as fs from 'fs';
+
+const license = fs.readFileSync(__dirname + '/../../../LICENSE', 'utf-8');
+
+const licenseHtml = license
+ .replace(/\r\n/g, '\n')
+ .replace(/(.)\n(.)/g, '$1 $2')
+ .replace(/(^|\n)(.*?)($|\n)/g, '<p>$2</p>');
+
+export {
+ license,
+ licenseHtml
+};
diff --git a/src/web/docs/license.en.pug b/src/web/docs/license.en.pug
new file mode 100644
index 0000000000..240756e7ea
--- /dev/null
+++ b/src/web/docs/license.en.pug
@@ -0,0 +1,3 @@
+h1 License
+
+div!= common.license
diff --git a/src/web/docs/license.ja.pug b/src/web/docs/license.ja.pug
new file mode 100644
index 0000000000..1f44f3f5e7
--- /dev/null
+++ b/src/web/docs/license.ja.pug
@@ -0,0 +1,3 @@
+h1 ライセンス
+
+div!= common.license
diff --git a/src/web/docs/vars.ts b/src/web/docs/vars.ts
index 65b224fbff..95ae9ee629 100644
--- a/src/web/docs/vars.ts
+++ b/src/web/docs/vars.ts
@@ -4,6 +4,7 @@ import * as yaml from 'js-yaml';
import { fa } from '../../common/build/fa';
import config from '../../conf';
+import { licenseHtml } from '../../common/build/license';
const constants = require('../../const.json');
export default function(): { [key: string]: any } {
@@ -42,5 +43,7 @@ export default function(): { [key: string]: any } {
vars['facss'] = fa.dom.css();
+ vars['license'] = licenseHtml;
+
return vars;
}
diff --git a/webpack/module/rules/license.ts b/webpack/module/rules/license.ts
index 1795af960d..de8b7d79fb 100644
--- a/webpack/module/rules/license.ts
+++ b/webpack/module/rules/license.ts
@@ -2,13 +2,8 @@
* Inject license
*/
-import * as fs from 'fs';
const StringReplacePlugin = require('string-replace-webpack-plugin');
-
-const license = fs.readFileSync(__dirname + '/../../../LICENSE', 'utf-8')
- .replace(/\r\n/g, '\n')
- .replace(/(.)\n(.)/g, '$1 $2')
- .replace(/(^|\n)(.*?)($|\n)/g, '<p>$2</p>');
+import { licenseHtml } from '../../../src/common/build/license';
export default () => ({
enforce: 'pre',
@@ -16,7 +11,7 @@ export default () => ({
exclude: /node_modules/,
loader: StringReplacePlugin.replace({
replacements: [{
- pattern: '%license%', replacement: () => license
+ pattern: '%license%', replacement: () => licenseHtml
}]
})
});