diff --git a/src/client/app/common/views/pages/explore.vue b/src/client/app/common/views/pages/explore.vue index f28760e51..507b0638b 100644 --- a/src/client/app/common/views/pages/explore.vue +++ b/src/client/app/common/views/pages/explore.vue @@ -143,7 +143,11 @@ export default Vue.extend({ this.$root.getMeta().then(meta => { this.meta = meta; }); - } + }, + + mounted() { + document.title = this.$root.instanceName; + }, }); diff --git a/src/client/app/common/views/pages/favorites.vue b/src/client/app/common/views/pages/favorites.vue index 36403dde5..e396615a9 100644 --- a/src/client/app/common/views/pages/favorites.vue +++ b/src/client/app/common/views/pages/favorites.vue @@ -40,5 +40,9 @@ export default Vue.extend({ icon: faStar }); }, + + mounted() { + document.title = this.$root.instanceName; + }, }); diff --git a/src/client/app/common/views/pages/featured.vue b/src/client/app/common/views/pages/featured.vue index 161511998..c00361aa8 100644 --- a/src/client/app/common/views/pages/featured.vue +++ b/src/client/app/common/views/pages/featured.vue @@ -40,5 +40,9 @@ export default Vue.extend({ icon: faNewspaper }); }, + + mounted() { + document.title = this.$root.instanceName; + }, }); diff --git a/src/client/app/common/views/pages/pages.vue b/src/client/app/common/views/pages/pages.vue index d0a56ac2f..236330db4 100644 --- a/src/client/app/common/views/pages/pages.vue +++ b/src/client/app/common/views/pages/pages.vue @@ -52,6 +52,9 @@ export default Vue.extend({ icon: faStickyNote }); }, + mounted() { + document.title = this.$root.instanceName; + }, methods: { create() { this.$router.push(`/i/pages/new`); diff --git a/src/client/app/common/views/pages/user-groups.vue b/src/client/app/common/views/pages/user-groups.vue index a51a5f723..6501a2606 100644 --- a/src/client/app/common/views/pages/user-groups.vue +++ b/src/client/app/common/views/pages/user-groups.vue @@ -62,6 +62,8 @@ export default Vue.extend({ }; }, mounted() { + document.title = this.$root.instanceName; + this.$root.api('users/groups/owned').then(groups => { this.ownedGroups = groups; }); diff --git a/src/client/app/common/views/pages/user-lists.vue b/src/client/app/common/views/pages/user-lists.vue index 29085935c..955eef993 100644 --- a/src/client/app/common/views/pages/user-lists.vue +++ b/src/client/app/common/views/pages/user-lists.vue @@ -33,6 +33,8 @@ export default Vue.extend({ }; }, mounted() { + document.title = this.$root.instanceName; + this.$root.api('users/lists/list').then(lists => { this.fetching = false; this.lists = lists; diff --git a/src/client/app/desktop/views/home/timeline.vue b/src/client/app/desktop/views/home/timeline.vue index b870395c1..224b93799 100644 --- a/src/client/app/desktop/views/home/timeline.vue +++ b/src/client/app/desktop/views/home/timeline.vue @@ -94,6 +94,8 @@ export default Vue.extend({ }, mounted() { + document.title = this.$root.instanceName; + (this.$refs.tl as any).$once('loaded', () => { this.$emit('loaded'); }); diff --git a/src/client/app/desktop/views/pages/settings.vue b/src/client/app/desktop/views/pages/settings.vue index 7aba863b7..29188277f 100644 --- a/src/client/app/desktop/views/pages/settings.vue +++ b/src/client/app/desktop/views/pages/settings.vue @@ -13,6 +13,9 @@ export default Vue.extend({ components: { XSettings: () => import('../components/settings.vue').then(m => m.default) }, + mounted() { + document.title = this.$root.instanceName; + }, }); diff --git a/src/client/app/mios.ts b/src/client/app/mios.ts index cb25eaa83..085a32759 100644 --- a/src/client/app/mios.ts +++ b/src/client/app/mios.ts @@ -28,7 +28,12 @@ export default class MiOS extends EventEmitter { }; public get instanceName() { - return this.meta ? (this.meta.data.name || 'Misskey') : 'Misskey'; + const siteName = document.querySelector('meta[property="og:site_name"]') as HTMLMetaElement; + if (siteName && siteName.content) { + return siteName.content; + } + + return 'Misskey'; } private isMetaFetching = false; diff --git a/src/client/app/mobile/views/pages/notifications.vue b/src/client/app/mobile/views/pages/notifications.vue index e71a855d5..24f8f79cc 100644 --- a/src/client/app/mobile/views/pages/notifications.vue +++ b/src/client/app/mobile/views/pages/notifications.vue @@ -25,6 +25,9 @@ export default Vue.extend({ faBell, }; }, + mounted() { + document.title = this.$root.instanceName; + }, methods: { beforeInit() { Progress.start(); diff --git a/src/server/web/index.ts b/src/server/web/index.ts index 6c41bbde4..50f006e34 100644 --- a/src/server/web/index.ts +++ b/src/server/web/index.ts @@ -164,7 +164,8 @@ router.get('/@:user', async (ctx, next) => { await ctx.render('user', { user, profile, me, - instanceName: meta.name || 'Misskey' + instanceName: meta.name || 'Misskey', + icon: meta.iconUrl }); ctx.set('Cache-Control', 'public, max-age=30'); } else { @@ -197,7 +198,8 @@ router.get('/notes/:note', async ctx => { await ctx.render('note', { note: _note, summary: getNoteSummary(_note), - instanceName: meta.name || 'Misskey' + instanceName: meta.name || 'Misskey', + icon: meta.iconUrl }); if (['public', 'home'].includes(note.visibility)) { @@ -283,6 +285,7 @@ router.get('*', async ctx => { await ctx.render('base', { img: meta.bannerUrl, title: meta.name || 'Misskey', + instanceName: meta.name || 'Misskey', desc: meta.description, icon: meta.iconUrl });