From c19670d6112227c578905a3d7eb54872ced08906 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Tue, 24 Sep 2019 04:08:52 +0900 Subject: [PATCH] Resolve #5447 (#5448) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Resolve syuilo#5447 * subページではalternateを表示しないように --- src/server/web/index.ts | 3 ++- src/server/web/views/user.pug | 13 +++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/server/web/index.ts b/src/server/web/index.ts index 50f006e345..f5845585ff 100644 --- a/src/server/web/index.ts +++ b/src/server/web/index.ts @@ -146,7 +146,7 @@ router.get('/@:user.json', async ctx => { //#region for crawlers // User -router.get('/@:user', async (ctx, next) => { +router.get(['/@:user', '/@:user/:sub'], async (ctx, next) => { const { username, host } = parseAcct(ctx.params.user); const user = await Users.findOne({ usernameLower: username.toLowerCase(), @@ -164,6 +164,7 @@ router.get('/@:user', async (ctx, next) => { await ctx.render('user', { user, profile, me, + sub: ctx.params.sub, instanceName: meta.name || 'Misskey', icon: meta.iconUrl }); diff --git a/src/server/web/views/user.pug b/src/server/web/views/user.pug index 7e7200439c..d41b0bbac0 100644 --- a/src/server/web/views/user.pug +++ b/src/server/web/views/user.pug @@ -30,12 +30,13 @@ block meta if profile.twitter meta(name='twitter:creator' content=`@${profile.twitter.screenName}`) - if !user.host - link(rel='alternate' href=`${config.url}/users/${user.id}` type='application/activity+json') - if user.uri - link(rel='alternate' href=user.uri type='application/activity+json') - if profile.url - link(rel='alternate' href=profile.url type='text/html') + if !sub + if !user.host + link(rel='alternate' href=`${config.url}/users/${user.id}` type='application/activity+json') + if user.uri + link(rel='alternate' href=user.uri type='application/activity+json') + if profile.url + link(rel='alternate' href=profile.url type='text/html') each m in me link(rel='me' href=`${m}`)