mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-11-23 06:25:14 +00:00
* Resolve syuilo#5447 * subページではalternateを表示しないように
This commit is contained in:
parent
540bd3630a
commit
c19670d611
2 changed files with 9 additions and 7 deletions
|
@ -146,7 +146,7 @@ router.get('/@:user.json', async ctx => {
|
||||||
|
|
||||||
//#region for crawlers
|
//#region for crawlers
|
||||||
// User
|
// User
|
||||||
router.get('/@:user', async (ctx, next) => {
|
router.get(['/@:user', '/@:user/:sub'], async (ctx, next) => {
|
||||||
const { username, host } = parseAcct(ctx.params.user);
|
const { username, host } = parseAcct(ctx.params.user);
|
||||||
const user = await Users.findOne({
|
const user = await Users.findOne({
|
||||||
usernameLower: username.toLowerCase(),
|
usernameLower: username.toLowerCase(),
|
||||||
|
@ -164,6 +164,7 @@ router.get('/@:user', async (ctx, next) => {
|
||||||
|
|
||||||
await ctx.render('user', {
|
await ctx.render('user', {
|
||||||
user, profile, me,
|
user, profile, me,
|
||||||
|
sub: ctx.params.sub,
|
||||||
instanceName: meta.name || 'Misskey',
|
instanceName: meta.name || 'Misskey',
|
||||||
icon: meta.iconUrl
|
icon: meta.iconUrl
|
||||||
});
|
});
|
||||||
|
|
|
@ -30,12 +30,13 @@ block meta
|
||||||
if profile.twitter
|
if profile.twitter
|
||||||
meta(name='twitter:creator' content=`@${profile.twitter.screenName}`)
|
meta(name='twitter:creator' content=`@${profile.twitter.screenName}`)
|
||||||
|
|
||||||
if !user.host
|
if !sub
|
||||||
link(rel='alternate' href=`${config.url}/users/${user.id}` type='application/activity+json')
|
if !user.host
|
||||||
if user.uri
|
link(rel='alternate' href=`${config.url}/users/${user.id}` type='application/activity+json')
|
||||||
link(rel='alternate' href=user.uri type='application/activity+json')
|
if user.uri
|
||||||
if profile.url
|
link(rel='alternate' href=user.uri type='application/activity+json')
|
||||||
link(rel='alternate' href=profile.url type='text/html')
|
if profile.url
|
||||||
|
link(rel='alternate' href=profile.url type='text/html')
|
||||||
|
|
||||||
each m in me
|
each m in me
|
||||||
link(rel='me' href=`${m}`)
|
link(rel='me' href=`${m}`)
|
||||||
|
|
Loading…
Reference in a new issue