From 5a13c38a6d27535da21894ca8642d722873c017f Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Sat, 8 Sep 2018 21:44:28 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=82=B9=E3=82=BF=E3=83=B3?= =?UTF-8?q?=E3=82=B9=E5=90=8D=E3=81=8C=E3=83=96=E3=83=A9=E3=82=A6=E3=82=B6?= =?UTF-8?q?=E3=82=BF=E3=82=A4=E3=83=88=E3=83=AB=E3=81=AB=E5=8F=8D=E6=98=A0?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=81=AA=E3=81=84=E3=81=AE=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20(#2668)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * titleが反映されないのを修正 * deckでtitleが反映されるように修正 --- src/client/app/config.ts | 2 ++ src/client/app/desktop/views/pages/deck/deck.vue | 1 + src/client/app/mios.ts | 4 ++-- src/server/web/views/note.pug | 2 +- src/server/web/views/user.pug | 2 +- webpack.config.ts | 4 +++- 6 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/client/app/config.ts b/src/client/app/config.ts index a326c521d..2e464c50f 100644 --- a/src/client/app/config.ts +++ b/src/client/app/config.ts @@ -5,6 +5,7 @@ declare const _COPYRIGHT_: string; declare const _VERSION_: string; declare const _CODENAME_: string; declare const _ENV_: string; +declare const _NAME_: string; const address = new URL(location.href); @@ -20,3 +21,4 @@ export const copyright = _COPYRIGHT_; export const version = _VERSION_; export const codename = _CODENAME_; export const env = _ENV_; +export const name = _NAME_; diff --git a/src/client/app/desktop/views/pages/deck/deck.vue b/src/client/app/desktop/views/pages/deck/deck.vue index 26b989656..5e7a07ea6 100644 --- a/src/client/app/desktop/views/pages/deck/deck.vue +++ b/src/client/app/desktop/views/pages/deck/deck.vue @@ -85,6 +85,7 @@ export default Vue.extend({ }, mounted() { + document.title = (this as any).os.instanceName; document.documentElement.style.overflow = 'hidden'; }, diff --git a/src/client/app/mios.ts b/src/client/app/mios.ts index 0f72cd2f3..d9d4ee9a0 100644 --- a/src/client/app/mios.ts +++ b/src/client/app/mios.ts @@ -3,7 +3,7 @@ import { EventEmitter } from 'eventemitter3'; import * as uuid from 'uuid'; import initStore from './store'; -import { apiUrl, version, lang } from './config'; +import { apiUrl, version, lang, name } from './config'; import Progress from './common/scripts/loading'; import Connection from './common/scripts/streaming/stream'; import { HomeStreamManager } from './common/scripts/streaming/home'; @@ -72,7 +72,7 @@ export default class MiOS extends EventEmitter { }; public get instanceName() { - return this.meta ? this.meta.data.name : 'Misskey'; + return this.meta ? this.meta.data.name : name; } private isMetaFetching = false; diff --git a/src/server/web/views/note.pug b/src/server/web/views/note.pug index 4f7c3d777..234ecabe2 100644 --- a/src/server/web/views/note.pug +++ b/src/server/web/views/note.pug @@ -6,7 +6,7 @@ block vars - const url = `${config.url}/notes/${note.id}`; block title - = `${title} | Misskey` + = `${title} | ${config.name}` block desc meta(name='description' content= summary) diff --git a/src/server/web/views/user.pug b/src/server/web/views/user.pug index 63d2f7515..506a889d9 100644 --- a/src/server/web/views/user.pug +++ b/src/server/web/views/user.pug @@ -6,7 +6,7 @@ block vars - const img = user.avatarId ? `${config.drive_url}/${user.avatarId}` : null; block title - = `${title} | Misskey` + = `${title} | ${config.name}` block desc meta(name='description' content= user.description) diff --git a/webpack.config.ts b/webpack.config.ts index a50d6c40c..bc1c0ddbc 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -22,6 +22,7 @@ const locales = require('./locales'); const meta = require('./package.json'); const version = `${meta.clientVersion}-${rndstr({ length: 8, chars: '0-9a-z' })}`; const codename = meta.codename; +import config from './src/config'; declare var global: { faReplacement: typeof faReplacement; @@ -75,7 +76,8 @@ const consts = { _CODENAME_: codename, _LANG_: '%lang%', _LANGS_: Object.keys(locales).map(l => [l, locales[l].meta.lang]), - _ENV_: process.env.NODE_ENV + _ENV_: process.env.NODE_ENV, + _NAME_: config.name }; const _consts: { [ key: string ]: any } = {};