[backend/razor] Add rel=alternate links to UserPreview and NotePreview
This commit is contained in:
parent
9cad98f9e8
commit
ca2b64a7ad
6 changed files with 6 additions and 0 deletions
|
@ -48,6 +48,7 @@ public class NoteRenderer(
|
|||
Text = renderedText?.Html,
|
||||
Cw = note.Cw,
|
||||
RawText = note.Text,
|
||||
Uri = note.Uri ?? note.GetPublicUri(instance.Value),
|
||||
QuoteUrl = note.Renote?.Url ?? note.Renote?.Uri ?? note.Renote?.GetPublicUriOrNull(instance.Value),
|
||||
QuoteInaccessible = note.Renote?.VisibilityIsPublicOrHome == false,
|
||||
Attachments = attachments[note.Id]?.Where(p => !inlineMediaUrls.Contains(p.Url)).ToList(),
|
||||
|
|
|
@ -32,6 +32,7 @@ public class UserRenderer(
|
|||
Id = user.Id,
|
||||
Username = user.Username,
|
||||
Host = user.Host ?? instance.Value.AccountDomain,
|
||||
Uri = user.GetUriOrPublicUri(instance.Value),
|
||||
Url = user.UserProfile?.Url ?? user.Uri ?? user.PublicUrlPath,
|
||||
AvatarUrl = user.GetAvatarUrl(instance.Value),
|
||||
BannerUrl = user.GetBannerUrl(instance.Value),
|
||||
|
|
|
@ -8,6 +8,7 @@ public class PreviewNote
|
|||
public required string? RawText;
|
||||
public required MarkupString? Text;
|
||||
public required string? Cw;
|
||||
public required string? Uri;
|
||||
public required string? QuoteUrl;
|
||||
public required bool QuoteInaccessible;
|
||||
public required List<PreviewAttachment>? Attachments;
|
||||
|
|
|
@ -11,6 +11,7 @@ public class PreviewUser
|
|||
public required string Username;
|
||||
public required string Host;
|
||||
public required string Url;
|
||||
public required string Uri;
|
||||
public required string AvatarUrl;
|
||||
public required string? BannerUrl;
|
||||
public required string? MovedToUri;
|
||||
|
|
|
@ -127,6 +127,7 @@ else
|
|||
<meta name="og:title" content="@title">
|
||||
<meta name="og:image" content="@previewImageUrl">
|
||||
<meta name="og:description" content="@description">
|
||||
<link rel="alternate" type="application/activity+json" href="@_note.Uri">
|
||||
|
||||
<VersionedLink rel="stylesheet" href="/css/public-preview.css"/>
|
||||
</HeadContent>
|
||||
|
|
|
@ -42,6 +42,7 @@ else
|
|||
<meta name="og:description" content="@bio">
|
||||
}
|
||||
<meta name="og:image" content="@_user.AvatarUrl">
|
||||
<link rel="alternate" type="application/activity+json" href="@_user.Uri">
|
||||
<VersionedLink rel="stylesheet" href="/css/public-preview.css"/>
|
||||
</HeadContent>
|
||||
}
|
Loading…
Add table
Reference in a new issue