@(Model.Post.Title ?? "Post Details")
@if (!string.IsNullOrWhiteSpace(Model.Post.Description)) {@Model.Post.Description
}@Model.Post.Description
} @Html.Raw(Model.Post.Content)Post not found.
@page "/p/{slug}" @using NodaTime @model DysonNetwork.Zone.Pages.Posts.DetailsModel @{ Layout = "_LayoutContained"; var post = Model.Post; var pageTitle = post?.Title ?? "Post"; var pageDescription = post?.Description; string? ogImageUrl = null; var canonicalUrl = $"{Request.Scheme}://{Request.Host}{Request.Path}{Request.QueryString}"; if (post != null) { if (string.IsNullOrWhiteSpace(pageDescription) && !string.IsNullOrWhiteSpace(post.Content)) { var plainText = System.Text.RegularExpressions.Regex.Replace(post.Content, "<.*?>", string.Empty); pageDescription = plainText.Length > 160 ? plainText.Substring(0, 157) + "..." : plainText; } var imageAttachment = post.Attachments.FirstOrDefault(a => a.MimeType != null && a.MimeType.StartsWith("image")); if (imageAttachment != null) { ogImageUrl = $"{Request.Scheme}://{Request.Host}/drive/files/{imageAttachment.Id}"; } } } @section Head {
@Model.Post.Description
}@Model.Post.Description
} @Html.Raw(Model.Post.Content)Post not found.