diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-12-17 01:41:22 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-12-17 01:41:22 +0900 |
| commit | 076956640871df99249e43e7df133f4f4e06043e (patch) | |
| tree | bc48a3d3e79e6bddddea28b8d7b848fc3e77f11a /src/web | |
| parent | v3390 (diff) | |
| download | sharkey-076956640871df99249e43e7df133f4f4e06043e.tar.gz sharkey-076956640871df99249e43e7df133f4f4e06043e.tar.bz2 sharkey-076956640871df99249e43e7df133f4f4e06043e.zip | |
:v:
Diffstat (limited to 'src/web')
| -rw-r--r-- | src/web/app/common/tags/introduction.tag | 2 | ||||
| -rw-r--r-- | src/web/app/common/tags/nav-links.tag | 5 | ||||
| -rw-r--r-- | src/web/app/common/tags/signup.tag | 4 | ||||
| -rw-r--r-- | src/web/app/common/tags/twitter-setting.tag | 2 | ||||
| -rw-r--r-- | src/web/app/desktop/tags/pages/entrance.tag | 2 | ||||
| -rw-r--r-- | src/web/app/mobile/tags/ui.tag | 4 | ||||
| -rw-r--r-- | src/web/docs/about.en.pug | 3 | ||||
| -rw-r--r-- | src/web/docs/about.ja.pug | 3 | ||||
| -rw-r--r-- | src/web/docs/api/endpoints/view.pug | 2 | ||||
| -rw-r--r-- | src/web/docs/api/entities/view.pug | 2 | ||||
| -rw-r--r-- | src/web/docs/api/mixins.pug | 4 | ||||
| -rw-r--r-- | src/web/docs/gulpfile.ts | 2 | ||||
| -rw-r--r-- | src/web/docs/layout.pug | 4 | ||||
| -rw-r--r-- | src/web/docs/server.ts | 21 | ||||
| -rw-r--r-- | src/web/docs/tou.ja.pug | 3 | ||||
| -rw-r--r-- | src/web/docs/tou.md | 4 | ||||
| -rw-r--r-- | src/web/server.ts | 11 |
17 files changed, 55 insertions, 23 deletions
diff --git a/src/web/app/common/tags/introduction.tag b/src/web/app/common/tags/introduction.tag index 3256688d10..28afc6fa46 100644 --- a/src/web/app/common/tags/introduction.tag +++ b/src/web/app/common/tags/introduction.tag @@ -3,7 +3,7 @@ <h1>Misskeyとは?</h1> <p><ruby>Misskey<rt>みすきー</rt></ruby>は、<a href="http://syuilo.com" target="_blank">syuilo</a>が2014年くらいから<a href="https://github.com/syuilo/misskey" target="_blank">オープンソースで</a>開発・運営を行っている、ミニブログベースのSNSです。</p> <p>無料で誰でも利用でき、広告も掲載していません。</p> - <p><a href={ _ABOUT_URL_ } target="_blank">もっと知りたい方はこちら</a></p> + <p><a href={ _DOCS_URL_ } target="_blank">もっと知りたい方はこちら</a></p> </article> <style> :scope diff --git a/src/web/app/common/tags/nav-links.tag b/src/web/app/common/tags/nav-links.tag index 71f0453db0..ea122575aa 100644 --- a/src/web/app/common/tags/nav-links.tag +++ b/src/web/app/common/tags/nav-links.tag @@ -1,7 +1,10 @@ <mk-nav-links> - <a href={ _ABOUT_URL_ }>%i18n:common.tags.mk-nav-links.about%</a><i>・</i><a href={ _STATS_URL_ }>%i18n:common.tags.mk-nav-links.stats%</a><i>・</i><a href={ _STATUS_URL_ }>%i18n:common.tags.mk-nav-links.status%</a><i>・</i><a href="http://zawazawa.jp/misskey/">%i18n:common.tags.mk-nav-links.wiki%</a><i>・</i><a href="https://github.com/syuilo/misskey/blob/master/DONORS.md">%i18n:common.tags.mk-nav-links.donors%</a><i>・</i><a href="https://github.com/syuilo/misskey">%i18n:common.tags.mk-nav-links.repository%</a><i>・</i><a href={ _DEV_URL_ }>%i18n:common.tags.mk-nav-links.develop%</a><i>・</i><a href="https://twitter.com/misskey_xyz" target="_blank">Follow us on %fa:B twitter%</a> + <a href={ aboutUrl }>%i18n:common.tags.mk-nav-links.about%</a><i>・</i><a href={ _STATS_URL_ }>%i18n:common.tags.mk-nav-links.stats%</a><i>・</i><a href={ _STATUS_URL_ }>%i18n:common.tags.mk-nav-links.status%</a><i>・</i><a href="http://zawazawa.jp/misskey/">%i18n:common.tags.mk-nav-links.wiki%</a><i>・</i><a href="https://github.com/syuilo/misskey/blob/master/DONORS.md">%i18n:common.tags.mk-nav-links.donors%</a><i>・</i><a href="https://github.com/syuilo/misskey">%i18n:common.tags.mk-nav-links.repository%</a><i>・</i><a href={ _DEV_URL_ }>%i18n:common.tags.mk-nav-links.develop%</a><i>・</i><a href="https://twitter.com/misskey_xyz" target="_blank">Follow us on %fa:B twitter%</a> <style> :scope display inline </style> + <script> + this.aboutUrl = `${_DOCS_URL_}/${_LANG_}/about`; + </script> </mk-nav-links> diff --git a/src/web/app/common/tags/signup.tag b/src/web/app/common/tags/signup.tag index 4816fe66db..b488efb927 100644 --- a/src/web/app/common/tags/signup.tag +++ b/src/web/app/common/tags/signup.tag @@ -34,7 +34,7 @@ </label> <label class="agree-tou"> <input name="agree-tou" type="checkbox" autocomplete="off" required="required"/> - <p><a href="https://github.com/syuilo/misskey/blob/master/src/docs/tou.md" target="_blank">利用規約</a>に同意する</p> + <p><a href={ touUrl } target="_blank">利用規約</a>に同意する</p> </label> <button onclick={ onsubmit }>%i18n:common.tags.mk-signup.create%</button> </form> @@ -182,6 +182,8 @@ this.passwordRetypeState = null; this.recaptchaed = false; + this.aboutUrl = `${_DOCS_URL_}/${_LANG_}/tou`; + window.onRecaptchaed = () => { this.recaptchaed = true; this.update(); diff --git a/src/web/app/common/tags/twitter-setting.tag b/src/web/app/common/tags/twitter-setting.tag index 3b70505ba2..4d57cfa55a 100644 --- a/src/web/app/common/tags/twitter-setting.tag +++ b/src/web/app/common/tags/twitter-setting.tag @@ -1,5 +1,5 @@ <mk-twitter-setting> - <p>%i18n:common.tags.mk-twitter-setting.description%<a href={ _ABOUT_URL_ + '/link-to-twitter' } target="_blank">%i18n:common.tags.mk-twitter-setting.detail%</a></p> + <p>%i18n:common.tags.mk-twitter-setting.description%<a href={ _DOCS_URL_ + '/link-to-twitter' } target="_blank">%i18n:common.tags.mk-twitter-setting.detail%</a></p> <p class="account" if={ I.twitter } title={ 'Twitter ID: ' + I.twitter.user_id }>%i18n:common.tags.mk-twitter-setting.connected-to%: <a href={ 'https://twitter.com/' + I.twitter.screen_name } target="_blank">@{ I.twitter.screen_name }</a></p> <p> <a href={ _API_URL_ + '/connect/twitter' } target="_blank" onclick={ connect }>{ I.twitter ? '%i18n:common.tags.mk-twitter-setting.reconnect%' : '%i18n:common.tags.mk-twitter-setting.connect%' }</a> diff --git a/src/web/app/desktop/tags/pages/entrance.tag b/src/web/app/desktop/tags/pages/entrance.tag index 44548e4183..b07b22c80c 100644 --- a/src/web/app/desktop/tags/pages/entrance.tag +++ b/src/web/app/desktop/tags/pages/entrance.tag @@ -150,7 +150,7 @@ </mk-entrance> <mk-entrance-signin> - <a class="help" href={ _ABOUT_URL_ + '/help' } title="お困りですか?">%fa:question%</a> + <a class="help" href={ _DOCS_URL_ + '/help' } title="お困りですか?">%fa:question%</a> <div class="form"> <h1><img if={ user } src={ user.avatar_url + '?thumbnail&size=32' }/> <p>{ user ? user.name : 'アカウント' }</p> diff --git a/src/web/app/mobile/tags/ui.tag b/src/web/app/mobile/tags/ui.tag index 62e128489a..621f89f336 100644 --- a/src/web/app/mobile/tags/ui.tag +++ b/src/web/app/mobile/tags/ui.tag @@ -248,7 +248,7 @@ <li><a href="/i/settings">%fa:cog%%i18n:mobile.tags.mk-ui-nav.settings%%fa:angle-right%</a></li> </ul> </div> - <a href={ _ABOUT_URL_ }><p class="about">%i18n:mobile.tags.mk-ui-nav.about%</p></a> + <a href={ aboutUrl }><p class="about">%i18n:mobile.tags.mk-ui-nav.about%</p></a> </div> <style> :scope @@ -359,6 +359,8 @@ this.connection = this.stream.getConnection(); this.connectionId = this.stream.use(); + this.aboutUrl = `${_DOCS_URL_}/${_LANG_}/about`; + this.on('mount', () => { this.connection.on('read_all_notifications', this.onReadAllNotifications); this.connection.on('read_all_messaging_messages', this.onReadAllMessagingMessages); diff --git a/src/web/docs/about.en.pug b/src/web/docs/about.en.pug new file mode 100644 index 0000000000..893d9dd6a1 --- /dev/null +++ b/src/web/docs/about.en.pug @@ -0,0 +1,3 @@ +h1 About Misskey + +p Misskey is a mini blog SNS. diff --git a/src/web/docs/about.ja.pug b/src/web/docs/about.ja.pug new file mode 100644 index 0000000000..fec933b0c6 --- /dev/null +++ b/src/web/docs/about.ja.pug @@ -0,0 +1,3 @@ +h1 Misskeyについて + +p MisskeyはミニブログSNSです。 diff --git a/src/web/docs/api/endpoints/view.pug b/src/web/docs/api/endpoints/view.pug index 62a6f59edd..9ba1c4e852 100644 --- a/src/web/docs/api/endpoints/view.pug +++ b/src/web/docs/api/endpoints/view.pug @@ -2,7 +2,7 @@ extends ../../layout.pug include ../mixins block meta - link(rel="stylesheet" href="/assets/docs/api/endpoints/style.css") + link(rel="stylesheet" href="/assets/api/endpoints/style.css") block main h1= endpoint diff --git a/src/web/docs/api/entities/view.pug b/src/web/docs/api/entities/view.pug index 57c6d4cad7..6fc05bd555 100644 --- a/src/web/docs/api/entities/view.pug +++ b/src/web/docs/api/entities/view.pug @@ -2,7 +2,7 @@ extends ../../layout.pug include ../mixins block meta - link(rel="stylesheet" href="/assets/docs/api/entities/style.css") + link(rel="stylesheet" href="/assets/api/entities/style.css") block main h1= name diff --git a/src/web/docs/api/mixins.pug b/src/web/docs/api/mixins.pug index 3ddd7cb48a..5180698574 100644 --- a/src/web/docs/api/mixins.pug +++ b/src/web/docs/api/mixins.pug @@ -14,13 +14,13 @@ mixin propTable(props) if prop.kind == 'id' if prop.entity | ( - a(href=`/docs/${lang}/api/entities/${kebab(prop.entity)}`)= prop.entity + a(href=`/${lang}/api/entities/${kebab(prop.entity)}`)= prop.entity | ID) else | (ID) else if prop.kind == 'entity' | ( - a(href=`/docs/${lang}/api/entities/${kebab(prop.entity)}`)= prop.entity + a(href=`/${lang}/api/entities/${kebab(prop.entity)}`)= prop.entity | ) else if prop.kind == 'object' if prop.def diff --git a/src/web/docs/gulpfile.ts b/src/web/docs/gulpfile.ts index 2377844650..61e44a1dc3 100644 --- a/src/web/docs/gulpfile.ts +++ b/src/web/docs/gulpfile.ts @@ -70,5 +70,5 @@ gulp.task('doc:styles', () => gulp.src('./src/web/docs/**/*.styl') .pipe(stylus()) .pipe((cssnano as any)()) - .pipe(gulp.dest('./built/web/assets/docs/')) + .pipe(gulp.dest('./built/web/docs/assets/')) ); diff --git a/src/web/docs/layout.pug b/src/web/docs/layout.pug index ac3743d2f4..bc9710d7c6 100644 --- a/src/web/docs/layout.pug +++ b/src/web/docs/layout.pug @@ -6,9 +6,9 @@ html(lang= lang) meta(name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no") title | #{title} | Misskey Docs - link(rel="stylesheet" href="/assets/docs/style.css") + link(rel="stylesheet" href="/assets/style.css") block meta - base(href=`/docs/${lang}/`) + base(href=`/${lang}/`) body nav diff --git a/src/web/docs/server.ts b/src/web/docs/server.ts new file mode 100644 index 0000000000..b2e50457e5 --- /dev/null +++ b/src/web/docs/server.ts @@ -0,0 +1,21 @@ +/** + * Docs Server + */ + +import * as express from 'express'; + +/** + * Init app + */ +const app = express(); +app.disable('x-powered-by'); + +app.use('/assets', express.static(`${__dirname}/assets`)); + +/** + * Routing + */ +app.get(/^\/([a-z_\-\/]+?)$/, (req, res) => + res.sendFile(`${__dirname}/${req.params[0]}.html`)); + +module.exports = app; diff --git a/src/web/docs/tou.ja.pug b/src/web/docs/tou.ja.pug new file mode 100644 index 0000000000..7663258f82 --- /dev/null +++ b/src/web/docs/tou.ja.pug @@ -0,0 +1,3 @@ +h1 利用規約 + +p 公序良俗に反する行為はおやめください。 diff --git a/src/web/docs/tou.md b/src/web/docs/tou.md deleted file mode 100644 index fbf87867b4..0000000000 --- a/src/web/docs/tou.md +++ /dev/null @@ -1,4 +0,0 @@ -利用規約 -================================================================ - -公序良俗に反する行為はおやめください。 diff --git a/src/web/server.ts b/src/web/server.ts index 38e87754f3..062d1f197a 100644 --- a/src/web/server.ts +++ b/src/web/server.ts @@ -10,6 +10,9 @@ import * as express from 'express'; import * as bodyParser from 'body-parser'; import * as favicon from 'serve-favicon'; import * as compression from 'compression'; +import vhost = require('vhost'); + +import config from '../conf'; /** * Init app @@ -17,6 +20,8 @@ import * as compression from 'compression'; const app = express(); app.disable('x-powered-by'); +app.use(vhost(`docs.${config.host}`, require('./docs/server'))); + app.use(bodyParser.urlencoded({ extended: true })); app.use(bodyParser.json({ type: ['application/json', 'text/plain'] @@ -64,12 +69,6 @@ app.get('/manifest.json', (req, res) => app.get(/\/api:url/, require('./service/url-preview')); /** - * Docs - */ -app.get(/^\/docs\/([a-z_\-\/]+?)$/, (req, res) => - res.sendFile(`${__dirname}/docs/${req.params[0]}.html`)); - -/** * Routing */ app.get('*', (req, res) => { |