quest-reader/page_template.cshtml

75 lines
3.8 KiB
Plaintext

<!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 description = $"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 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>
</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>
<p>@description</p>
<p>Posts from @Model.Posts[0].Date - @Model.Posts[Model.Posts.Count -1].Date</p>
</header>
<main>
@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>
}
<article id="post-@item.Id" class="post@(item.File is not null ? " image-post" : "")">
@if (item.Title is not null) {
<h2 class="post-self-title">@item.Title</h2>
}
<h3 class="post-header"><a class="post-anchor" href="#post-@item.Id"><span class="post-anchor-mark">#</span>@item.Id</a> <span class="author">@item.Author</span> <time>@item.Date</time></h3>
<div class="post-content">
@if (item.File is not null) {
<figure class="post-image">
<img src="@Model.BaseUrl/@item.File" alt="@item.Filename">
</figure>
}
@if (item.RawHtml.Trim().Length > 0) {
<blockquote>@Raw(item.RawHtml)</blockquote>
}
</div>
</article>
}
</main>
<footer>
<p>Ⓒ @Model.Metadata.Author @Model.Posts[0].Date.Year - @Model.Posts[Model.Posts.Count -1].Date.Year, page generated with quest_reader by <a href="https://saphi.re">Saphire</a></p>
</footer>
</body>
</html>