From 41ba06a5e601f85a42baa14b9c5f92de0a8477ac Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 6 Feb 2019 22:27:23 +0900 Subject: [PATCH] Fix bug --- src/server/web/index.ts | 10 ++++++++-- src/server/web/views/note.pug | 2 +- src/server/web/views/user.pug | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/server/web/index.ts b/src/server/web/index.ts index afb05923cd..3f2e1ed19f 100644 --- a/src/server/web/index.ts +++ b/src/server/web/index.ts @@ -143,7 +143,11 @@ router.get('/@:user', async (ctx, next) => { }); if (user != null) { - await ctx.render('user', { user }); + const meta = await fetchMeta(); + await ctx.render('user', { + user, + instanceName: meta.name + }); ctx.set('Cache-Control', 'public, max-age=180'); } else { // リモートユーザーなので @@ -179,9 +183,11 @@ router.get('/notes/:note', async ctx => { if (note) { const _note = await packNote(note); + const meta = await fetchMeta(); await ctx.render('note', { note: _note, - summary: getNoteSummary(_note) + summary: getNoteSummary(_note), + instanceName: meta.name }); if (['public', 'home'].includes(note.visibility)) { diff --git a/src/server/web/views/note.pug b/src/server/web/views/note.pug index 2d07aff2ed..782a32a504 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} | ${config.name}` + = `${title} | ${instanceName}` block desc meta(name='description' content= summary) diff --git a/src/server/web/views/user.pug b/src/server/web/views/user.pug index 7810a8b9b2..04109c687b 100644 --- a/src/server/web/views/user.pug +++ b/src/server/web/views/user.pug @@ -6,7 +6,7 @@ block vars - const img = user.avatarUrl || null; block title - = `${title} | ${config.name}` + = `${title} | ${instanceName}` block desc meta(name='description' content= user.description)