43 lines
1.3 KiB
HTML
43 lines
1.3 KiB
HTML
{{define "main-content"}}
|
|
{{if .Post.HasCode}}
|
|
<link rel="stylesheet" href="/src/thirdparty/highlight/default.min.css">
|
|
<script src="/src/thirdparty/highlight/highlight.min.js"></script>
|
|
{{range .Post.CodeLangs}}
|
|
<script src="/src/thirdparty/highlight/languages/{{.}}.min.js"></script>
|
|
{{end}}
|
|
{{if .Post.HasErgon}}
|
|
<script src="/src/lang/ergon.js"></script>{{end}}
|
|
{{if .Post.HasArchASM}}
|
|
<script src="/src/lang/archasm.js"></script>{{end}}
|
|
{{end}}
|
|
{{if .Post.HTML}}
|
|
<article class="article">
|
|
<h1>{{.Post.Title}}</h1>
|
|
<time class="post-date">{{.Post.Date.Format "January 2, 2006"}}</time>
|
|
{{.Post.HTML | safehtml}}
|
|
</article>
|
|
<script>
|
|
(function check() {
|
|
if (typeof hljs === 'undefined') return setTimeout(check, 50);
|
|
document.querySelectorAll('pre code').forEach(el => hljs.highlightElement(el));
|
|
})();
|
|
</script>
|
|
{{else if .PostList}}
|
|
<h1>Field Notes</h1>
|
|
{{if .Posts}}
|
|
<ul class="post-list">
|
|
{{range .Posts}}
|
|
<li>
|
|
<a href="/blog/posts/{{.Slug}}" hx-get="/blog/posts/{{.Slug}}" hx-target="main" hx-push-url="true">{{.Title}}</a>
|
|
<span class="post-date-inline">{{.Date.Format "Jan 2, 2006"}}</span>
|
|
</li>
|
|
{{end}}
|
|
</ul>
|
|
{{else}}
|
|
<p style="color: var(--text-dim);">No posts yet.</p>
|
|
{{end}}
|
|
{{else}}
|
|
{{template "landing-content" .}}
|
|
{{end}}
|
|
{{end}}
|