96 lines
4.7 KiB
Plaintext
96 lines
4.7 KiB
Plaintext
@namespace QuestReader
|
|
@using System
|
|
@using System.Linq
|
|
@using QuestReader.Models
|
|
@using QuestReader.Services
|
|
@using QuestReader.Extensions
|
|
@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.AssetsPath}/{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, object> makePost =
|
|
@<article id="post-@item.Id" class="post@(item.File is not null ? " image-post" : "")@(item.AuthorPost ? "" : " suggestion-post")" data-postid="@item.Id">
|
|
@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.AssetsPath/@item.File" alt="@item.Filename">
|
|
</figure>
|
|
}
|
|
@if (item.RawHtml.Trim().Length > 0) {
|
|
<div class="post-text">@Raw(item.ParsedContent!.RenderContentHtml(Model))</div>
|
|
}
|
|
</div>
|
|
</article>
|
|
;
|
|
}
|
|
@foreach (var item in Model.Posts)
|
|
{
|
|
@if (item.IsChapterAnnounce) {
|
|
// This might nullref throw, but let's assume this bool is always set only when this is set too
|
|
<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>
|
|
}
|
|
|
|
@makePost(item);
|
|
}
|
|
</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> |