Skip to content

Commit 0c3de46

Browse files
authored
enhance(OGP): ユーザーやノートのOGPでローカルとリモートユーザーの見分けが付かない問題を修正 (MisskeyIO#528)
1 parent c2e1f60 commit 0c3de46

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/backend/src/server/web/views/note.pug

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ extends ./base
22

33
block vars
44
- const user = note.user;
5-
- const title = user.name ? `${user.name} (@${user.username})` : `@${user.username}`;
5+
- const title = user.name ? `${user.name} (@${user.username}${user.host ? `@${user.host}` : ''})` : `@${user.username}${user.host ? `@${user.host}` : ''}`;
66
- const url = `${config.url}/notes/${note.id}`;
77
- const isRenote = note.renote && note.text == null && note.fileIds.length == 0 && note.poll == null;
88
- const images = (note.files || []).filter(file => file.type.startsWith('image/') && !file.isSensitive)
@@ -28,7 +28,7 @@ block og
2828
// FIXME: add embed player for Twitter
2929
if images.length
3030
meta(property='twitter:card' content='summary_large_image')
31-
each image in images
31+
each image in images
3232
meta(property='og:image' content= image.url)
3333
else
3434
meta(property='twitter:card' content='summary')

packages/backend/src/server/web/views/user.pug

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
extends ./base
22

33
block vars
4-
- const title = user.name ? `${user.name} (@${user.username})` : `@${user.username}`;
4+
- const title = user.name ? `${user.name} (@${user.username}${user.host ? `@${user.host}` : ''})` : `@${user.username}${user.host ? `@${user.host}` : ''}`;
55
- const url = `${config.url}/@${(user.host ? `${user.username}@${user.host}` : user.username)}`;
66

77
block title

0 commit comments

Comments
 (0)