add blog index to admin dashboard

This commit is contained in:
ari melody 2025-11-07 01:04:10 +00:00
parent ee8bf6543e
commit 65366032fd
Signed by: ari
GPG key ID: CF99829C92678188
10 changed files with 603 additions and 91 deletions

View file

@ -0,0 +1,33 @@
{{define "head"}}
<title>Blog - ari melody 💫</title>
<link rel="shortcut icon" href="/img/favicon.png" type="image/x-icon">
<link rel="stylesheet" href="/admin/static/blog.css">
{{end}}
{{define "content"}}
<main>
<header>
<h1>Blog Posts <small>({{.TotalPosts}} total)</small></h2>
<a class="button new" id="create-post">Create New</a>
</header>
{{if .Collections}}
<div class="blog-group">
{{range .Collections}}
{{if .Posts}}
<div class="blog-collection">
<h2>{{.Year}}</h2>
{{range .Posts}}
{{block "blogpost" .}}{{end}}
{{end}}
</div>
{{end}}
{{end}}
</div>
{{else}}
<p>There are no blog posts.</p>
{{end}}
</main>
<script type="module" src="/admin/static/blog.js"></script>
{{end}}