hugo-theme-readable

Fork of https://github.com/cjtheham/hugo-theme-readable
git clone https://git.eamoncaddigan.net/hugo-theme-readable.git
Log | Files | Refs | README | LICENSE

commit 304b5c053629b4deaaf2900e1a4fd0127b14f931
parent bbea1befdb1e78763979df676e6970139ce1ca5c
Author: CJ <cjtheham@protonmail.com>
Date:   Sun,  6 Aug 2023 01:40:56 -0500

Merge commit '37c9ef6b0d7ec7d48b4f2c80708ada5c016c256b' of https://git.eamoncaddigan.net/hugo-theme-readable

Diffstat:
Mlayouts/_default/list.html | 5++---
Mlayouts/partials/metadata.html | 6++++++
2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/layouts/_default/list.html b/layouts/_default/list.html @@ -1,9 +1,9 @@ {{ define "main" }} <h1>{{ .Title }}</h1> -{{ range .Pages.ByPublishDate.Reverse }} +{{ range .Pages.ByLastmod.Reverse }} <p> <h3><a class="title" href="{{ .RelPermalink }}">{{ .Title }}</a></h3> {{ partial "metadata.html" . }} </p> {{ end }} -{{ end }} -\ No newline at end of file +{{ end }} diff --git a/layouts/partials/metadata.html b/layouts/partials/metadata.html @@ -1,9 +1,15 @@ {{ $dateTime := .PublishDate.Format "2006-01-02" }} +{{ $lastmodTime := .Lastmod.Format "2006-01-02" }} {{ $dateFormat := .Site.Params.dateFormat | default "Jan 2, 2006" }} <i data-feather="calendar"></i> {{ if .PublishDate }} +{{ if and (ne $lastmodTime $dateTime) (gt .Lastmod .Date) }} + <time datetime="{{ $lastmodTime }}">{{ .Lastmod.Format $dateFormat }}</time> + (first posted <time datetime="{{ $dateTime }}">{{ .PublishDate.Format $dateFormat }}</time>) +{{ else }} <time datetime="{{ $dateTime }}">{{ .PublishDate.Format $dateFormat }}</time> {{ end }} +{{ end }} {{ with .Params.tags }} <i data-feather="tag"></i> {{ range . }}