98 lines
4.9 KiB
Plaintext
98 lines
4.9 KiB
Plaintext
@namespace QuestReader
|
|
@using System
|
|
@using System.Linq
|
|
@inherits StandaloneTemplate<TemplateModel>
|
|
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
<meta name="color-scheme" content="dark light">
|
|
|
|
@{
|
|
var title = $"\"{Model.Metadata.Name}\" by {Model.Metadata.Author}";
|
|
var autoDescription = $"Quest single-page archive. Generated {Model.Now} (UTC), {Model.Posts.Count} posts, {Model.Metadata.Chapters.Count} chapters";
|
|
// A hack, tbh, should be something better instead..
|
|
var description = Model.Metadata.Description ?? autoDescription;
|
|
var preview = $"https://media.lunar.exchange{Model.BaseUrl}/{Model.Metadata.SocialPreview}";
|
|
}
|
|
<title>@title</title>
|
|
<link rel="stylesheet" href="main.css">
|
|
|
|
<meta name="author" content="@Model.Metadata.Author">
|
|
<meta name="description" content="@description">
|
|
|
|
<meta name="twitter:card" content="summary_large_image"/>
|
|
<meta name="twitter:title" content="@title"/>
|
|
<meta name="twitter:description" content="@description"/>
|
|
<meta name="twitter:image" content="@preview"/>
|
|
@if (Model.Metadata.AuthorTwitter is not null) {
|
|
<meta name="twitter:creator" content="@("@")@Model.Metadata.AuthorTwitter">
|
|
}
|
|
<meta name="twitter:site" content="@@SaphireLattice">
|
|
|
|
<meta property="og:type" content="website"/>
|
|
<meta property="og:title" content="@title"/>
|
|
<meta property="og:description" content="@description"/>
|
|
<meta property="og:determiner" content="the"/>
|
|
<meta property="og:locale" content="en_US"/>
|
|
<meta property="og:image" content="@preview"/>
|
|
|
|
<!-- It's just Plausible Analytics - based on ip/etc and daily seed, no incoming requests log. Please email me if you think I am in violation of GDPR/etc -->
|
|
<script async defer data-domain="media.lunar.exchange" src="/js/aluminum.js"></script>
|
|
<script async defer src="main.js"></script>
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<h1><span class="quest-title">@Model.Metadata.Name</span> by <a href="@Model.Metadata.AuthorPage" class="quest-author">@Model.Metadata.Author</a></h1>
|
|
@if (Model.Metadata.Description is not null)
|
|
{
|
|
<p>@Model.Metadata.Description</p>
|
|
}
|
|
<p>@autoDescription</p>
|
|
<p>Posts from @Model.Posts.First().Date - @Model.Posts.Last().Date</p>
|
|
</header>
|
|
<main>
|
|
@{
|
|
Func<(ThreadPost, bool), object> makePost =
|
|
@<article id="post-@item.Item1.Id" class="post@(item.Item1 is not null ? " image-post" : "")@(item.Item2 ? "" : " suggestion-post")">
|
|
@if (item.Item1.Title is not null) {
|
|
<h2 class="post-self-title">@item.Item1.Title</h2>
|
|
}
|
|
<h3 class="post-header"><a class="post-anchor" href="#post-@item.Item1.Id"><span class="post-anchor-mark">#</span>@item.Item1.Id</a> <span class="author">@item.Item1.Author</span> <time>@item.Item1.Date</time></h3>
|
|
<div class="post-content">
|
|
@if (item.Item1.File is not null) {
|
|
<figure class="post-image">
|
|
<img src="@Model.BaseUrl/@item.Item1.File" alt="@item.Item1.Filename">
|
|
</figure>
|
|
}
|
|
@if (item.Item1.RawHtml.Trim().Length > 0) {
|
|
<div class="post-text">@Raw(item.Item1.RawHtml)</div>
|
|
}
|
|
</div>
|
|
</article>;
|
|
}
|
|
@foreach (var item in Model.Posts)
|
|
{
|
|
@if (item.IsChapterAnnounce) {
|
|
<h2 id="chapter-@item.Chapter.Id" class="chapter-announce">
|
|
<a class="chapter-anchor" href="#chapter-@item.Chapter.Id">#</a> <span class="chapter-name">@item.Chapter.Name</span> - <span class="chapter-subtitle">@item.Chapter.Subtitle</span>
|
|
</h2>
|
|
}
|
|
if (item.RepliesTo is not null && item.RepliesTo.Count > 0)
|
|
{
|
|
@foreach (var replyId in item.RepliesTo)
|
|
{
|
|
@makePost((Model.AllPosts.First(p => p.Id == replyId), false))
|
|
}
|
|
}
|
|
|
|
@makePost((item, true));
|
|
}
|
|
</main>
|
|
<footer>
|
|
<p>Ⓒ @Model.Metadata.Author @Model.Posts.First().Date.Year - @Model.Posts.Last().Date.Year, page generated with <span><a href="https://source.lunar.exchange/Saphire/quest-reader">quest-reader</a> v.<span class="commit-hash">@Model.ToolVersion</span></span> by <a href="https://saphi.re">Saphire</a></p>
|
|
</footer>
|
|
</body>
|
|
</html> |