@(Model.Post.Title ?? "Post Details")
@if (!string.IsNullOrWhiteSpace(Model.Post.Description)) {@Model.Post.Description
}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}"; } } ViewData["Title"] = pageTitle; } @section Head { @if (!string.IsNullOrWhiteSpace(pageDescription)) { } @if (!string.IsNullOrEmpty(ogImageUrl)) { } @if (post != null) { @if (post.EditedAt.HasValue) { } @foreach (var tagName in post.Tags.Select(tag => !string.IsNullOrEmpty(tag.Name) ? tag.Name : tag.Slug).Where(tagName => !string.IsNullOrEmpty(tagName))) { } } @if (!string.IsNullOrEmpty(ogImageUrl)) { } }
@Model.Post.Description
}Post not found.