zotan.pw-web/zotan.pw-web/Pages/blog/BlogPost.cshtml

23 lines
639 B
Plaintext
Raw Normal View History

2022-11-20 03:06:41 +01:00
@page "/blog/{post}"
@{
if (string.IsNullOrWhiteSpace((string)RouteData.Values["post"]!)) {
return;
}
var post = BlogModel.Posts.FirstOrDefault(p => p.Shorthand == (string)RouteData.Values["post"]!);
if (post == null) {
Response.Redirect("/Error");
return;
}
2022-11-20 20:48:22 +01:00
ViewData["title"] = "blog";
ViewData["subtitle"] = post.Shorthand;
2022-11-20 03:06:41 +01:00
#if (DEBUG)
2022-11-20 22:26:21 +01:00
post.UpdateContentAndMetadata();
2022-11-20 03:06:41 +01:00
#endif
}
<b>@post.PublishedOn.ToString("yyyy-MM-dd")</b> - @Utils.a_an(post.ReadTimeMinutes) @post.ReadTimeMinutes minute read (150 wpm)
<h1 id="post">IPv6-native networking: a project report</h1>
<div align="justify">
@Html.Raw(post.Content)
2022-11-20 22:26:21 +01:00
</div>