1
0
Fork 0

Clean up and improve some layouts

Adds tags and category shows to single pages.
Adds dates to list pages.
This commit is contained in:
Ethan Marshall 2024-08-02 00:33:05 +01:00
parent 9cc66e83af
commit 5da2f358e9
Signed by: ejv2
GPG key ID: EC2FAEF4DB8968D8
4 changed files with 26 additions and 6 deletions

View file

@ -2,7 +2,8 @@
title = 'Hello World'
date = 2024-08-01T04:21:56+01:00
author = 'Ethan Marshall'
draft = false
categories = ['tech']
tags = ['personal', 'web']
+++
Hello, world! This is my first testing post to see if this system will work. Nothing to see here!

View file

@ -5,7 +5,7 @@
<ul>
{{ range .Pages }}
{{ .Render "li" }}
<li><a href="{{ .Permalink }}">{{ .Title }}</a> -- {{ .Date.Format "2 January 2006" }}</li>
{{ end }}
</ul>

View file

@ -10,10 +10,29 @@
{{define "aside" }}
{{ if .Params.description }}<p>{{ .Params.description }}</p>{{ end }}
{{ if or (.Params.author) (.Params.date) }}
{{ if .Params.date }}
<p>
{{ if .Params.author }}By {{ .Params.author }}{{ if .Date }}, {{ end }}{{ end }}
{{ if .Date }}{{ .Date.Format "2006-01-02" }}{{ end }}
{{ if .Date }}<strong>First Published</strong> {{ .Date.Format "2006-01-02" }}{{ end }}
</p>
{{ end }}
{{if .Params.categories }}
<p>
<strong>Categories: [</strong>
{{ range .Params.categories }}
<a href="/categories/{{ . }}">{{ . }}</a>
{{ end }}
<strong>]</strong>
</p>
{{ end }}
{{if .Params.tags }}
<p>
<strong>Tags: [</strong>
{{ range .Params.tags }}
<a href="/tags/{{ . }}">{{ . }}</a>
{{ end }}
<strong>]</strong>
</p>
{{ end }}

View file

@ -7,7 +7,7 @@
{{ range .Pages }}
<article class="post">
<header class="post__header">
<h1><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a> - {{ .Date.Format "2 January 2006" }}</h1>
<h1><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a> -- {{ .Date.Format "2 January 2006" }}</h1>
</header>
<section class="post__summary">