This commit is contained in:
syuilo 2019-02-06 22:27:23 +09:00
parent d7ac0418d7
commit 41ba06a5e6
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
3 changed files with 10 additions and 4 deletions

View file

@ -143,7 +143,11 @@ router.get('/@:user', async (ctx, next) => {
}); });
if (user != null) { 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'); ctx.set('Cache-Control', 'public, max-age=180');
} else { } else {
// リモートユーザーなので // リモートユーザーなので
@ -179,9 +183,11 @@ router.get('/notes/:note', async ctx => {
if (note) { if (note) {
const _note = await packNote(note); const _note = await packNote(note);
const meta = await fetchMeta();
await ctx.render('note', { await ctx.render('note', {
note: _note, note: _note,
summary: getNoteSummary(_note) summary: getNoteSummary(_note),
instanceName: meta.name
}); });
if (['public', 'home'].includes(note.visibility)) { if (['public', 'home'].includes(note.visibility)) {

View file

@ -6,7 +6,7 @@ block vars
- const url = `${config.url}/notes/${note.id}`; - const url = `${config.url}/notes/${note.id}`;
block title block title
= `${title} | ${config.name}` = `${title} | ${instanceName}`
block desc block desc
meta(name='description' content= summary) meta(name='description' content= summary)

View file

@ -6,7 +6,7 @@ block vars
- const img = user.avatarUrl || null; - const img = user.avatarUrl || null;
block title block title
= `${title} | ${config.name}` = `${title} | ${instanceName}`
block desc block desc
meta(name='description' content= user.description) meta(name='description' content= user.description)