Styled the categories on the site

This commit is contained in:
Leon Mika 2026-03-22 10:28:33 +11:00
parent f45bdcd83c
commit d9aec4af2c
16 changed files with 176 additions and 59 deletions

View file

@ -0,0 +1,10 @@
<div class="post-meta">
<a href="{{ url_abs .Path }}">{{ format_date .Post.PublishedAt }}</a>
{{ if .Categories }}
<div class="post-categories">
{{ range .Categories }}
<a href="{{ url_abs (printf "/categories/%s" .Slug) }}">{{ .Name }}</a>
{{ end }}
</div>
{{ end }}
</div>

View file

@ -0,0 +1,9 @@
<h2>Categories</h2>
<ul class="category-list">
{{ range .Categories }}
<li>
<span class="category-list-name"><a href="{{ url_abs .Path }}">{{ .Name }}</a> ({{ .PostCount }})</span>
{{ if .DescriptionBrief }}<small>{{ .DescriptionBrief }}</small>{{ end }}
</li>
{{ end }}
</ul>

View file

@ -0,0 +1,11 @@
<h2>{{ .Category.Name }}</h2>
{{ if .DescriptionHTML }}
<div class="notice category-description">{{ .DescriptionHTML }}</div>
{{ end }}
{{ range .Posts }}
<div class="h-entry">
{{ if .Post.Title }}<h3>{{ .Post.Title }}</h3>{{ end }}
{{ .HTML }}
{{ template "_post_meta.html" . }}
</div>
{{ end }}

View file

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ .Site.Title }}</title>
<link rel="alternate" type="application/rss+xml" title="RSS Feed" href="{{ url_abs "/feed.xml" }}"/>
<link rel="alternate" type="application/json" title="JSON feed" href="{{ url_abs "/feed.json" }}"/>
<link rel="stylesheet" href="https://cdn.simplecss.org/simple.min.css">
<link rel="stylesheet" href="{{ url_abs "/static/style.css" }}">
</head>
<body>
<header>
<h1>{{ .Site.Title }}</h1>
<p>{{ .Site.Tagline }}</p>
</header>
<main>
{{ .Body }}
</main>
<footer>
<p>This site under construction.</p>
</footer>
</body>
</html>

View file

@ -0,0 +1,8 @@
{{ range .Posts }}
<div class="h-entry">
{{ if .Post.Title }}<h3>{{ .Post.Title }}</h3>{{ end }}
{{ .HTML }}
{{ template "_post_meta.html" . }}
</div>
{{ end }}

View file

@ -0,0 +1,5 @@
<div class="h-entry">
{{ if .Post.Title }}<h3>{{ .Post.Title }}</h3>{{ end }}
{{ .HTML }}
{{ template "_post_meta.html" . }}
</div>