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' title = 'Hello World'
date = 2024-08-01T04:21:56+01:00 date = 2024-08-01T04:21:56+01:00
author = 'Ethan Marshall' 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! 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> <ul>
{{ range .Pages }} {{ range .Pages }}
{{ .Render "li" }} <li><a href="{{ .Permalink }}">{{ .Title }}</a> -- {{ .Date.Format "2 January 2006" }}</li>
{{ end }} {{ end }}
</ul> </ul>

View file

@ -10,13 +10,32 @@
{{define "aside" }} {{define "aside" }}
{{ if .Params.description }}<p>{{ .Params.description }}</p>{{ end }} {{ if .Params.description }}<p>{{ .Params.description }}</p>{{ end }}
{{ if or (.Params.author) (.Params.date) }} {{ if .Params.date }}
<p> <p>
{{ if .Params.author }}By {{ .Params.author }}{{ if .Date }}, {{ end }}{{ end }} {{ if .Date }}<strong>First Published</strong> {{ .Date.Format "2006-01-02" }}{{ end }}
{{ if .Date }}{{ .Date.Format "2006-01-02" }}{{ end }}
</p> </p>
{{ end }} {{ 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 }}
{{ if and (.Params.toc) (.TableOfContents) }} {{ if and (.Params.toc) (.TableOfContents) }}
<hr> <hr>
On this page: On this page:

View file

@ -7,7 +7,7 @@
{{ range .Pages }} {{ range .Pages }}
<article class="post"> <article class="post">
<header class="post__header"> <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> </header>
<section class="post__summary"> <section class="post__summary">