From e20899f12306c981add3a5680aa03ee8df305743 Mon Sep 17 00:00:00 2001 From: Will Faught Date: Thu, 23 Feb 2023 21:09:06 -0800 Subject: [PATCH] Add paige.date param --- README.md | 3 +-- layouts/partials/paige/metadata.html | 22 +++++++++------------- layouts/partials/paige/pages.html | 20 ++++++++------------ 3 files changed, 18 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 45b7d195..0ced67ce 100644 --- a/README.md +++ b/README.md @@ -249,6 +249,7 @@ paige: hide: false # Don't credit this project in a data attribute link: hide: false # Don't credit this project in the footer + date: "published" # Page date displayed; must be "published" or "modified" header: menu: breakpoint: "sm" # Bootstrap breakpoint at which to display all menu items @@ -295,8 +296,6 @@ paige: class: "text-center text-secondary" format: ":date_long" # Hugo date format hide: false - lastmod: - hide: false description: class: "lead text-center" hide: false diff --git a/layouts/partials/paige/metadata.html b/layouts/partials/paige/metadata.html index 13a723b9..21fb7fd5 100644 --- a/layouts/partials/paige/metadata.html +++ b/layouts/partials/paige/metadata.html @@ -12,13 +12,11 @@ {{ $authorsclass := $page.Param "paige.main.metadata.authors.class" | default "paige-authors text-center text-secondary" }} {{ $categories := cond ($page.Param "paige.main.metadata.terms.hide" | not) ($page.Params.categories | default slice) slice | uniq }} {{ $commiturl := "" }} -{{ $date := cond ($page.Param "paige.main.metadata.date.hide" | not) $page.PublishDate "" }} +{{ $date := cond ($page.Param "paige.main.metadata.date.hide" | not) (cond (eq ($page.Param "paige.date" | default "published") "published") $page.PublishDate $page.Lastmod) "" }} {{ $dateclass := $page.Param "paige.main.metadata.date.class" | default "paige-date text-center text-secondary" }} {{ $dateformat := $page.Param "paige.main.metadata.date.format" | default ":date_long" }} {{ $description := cond ($page.Param "paige.main.metadata.description.hide" | not) ($page.Description | markdownify) "" }} {{ $descriptionclass := $page.Param "paige.main.metadata.description.class" | default "lead paige-description text-center" }} -{{ $lastmod := cond (eq $date $page.Lastmod) "" $page.Lastmod }} -{{ $lastmodshow := and $lastmod ($page.Param "paige.main.metadata.date.lastmod.hide" | not) }} {{ $nogap := "mb-0" }} {{ $readingtime := cond ($page.Param "paige.main.metadata.reading_time.hide" | not) $page.ReadingTime "" }} {{ $readingtimeclass := $page.Param "paige.main.metadata.reading_time.class" | default "paige-reading-time text-center text-secondary" }} @@ -68,16 +66,14 @@ {{ with $date }}

- {{ if $lastmodshow }} - · {{ with $commiturl }} {{ end }} {{ if $commiturl }} {{ end }} - {{ else }} - {{ with $commiturl }} - - {{ end }} - - {{ if $commiturl }} - - {{ end }} + {{ with $commiturl }} + + {{ end }} + + + + {{ if $commiturl }} + {{ end }}

{{ end }} diff --git a/layouts/partials/paige/pages.html b/layouts/partials/paige/pages.html index 37cb611e..baad2b6a 100644 --- a/layouts/partials/paige/pages.html +++ b/layouts/partials/paige/pages.html @@ -36,8 +36,6 @@ {{ $expired := and .ExpiryDate (lt .ExpiryDate now) }} {{ $flags := slice }} {{ $future := and .PublishDate (gt .PublishDate now) }} - {{ $lastmod := cond (eq $date .Lastmod) "" .Lastmod }} - {{ $lastmodshow := and $lastmod ($page.Param "paige.main.metadata.date.lastmod.hide" | not) }} {{ $modified := and .PublishDate .Lastmod (lt .PublishDate .Lastmod) }} {{ $readingtime := cond ($page.Param "paige.list.reading_time.hide" | not) .ReadingTime "" }} {{ $readingtimeclass := $page.Param "paige.list.reading_time.class" | default "mb-0 paige-reading-time text-center text-secondary" }} @@ -115,16 +113,14 @@ {{ with $date }}

- {{ if $lastmodshow }} - · {{ with $commiturl }} {{ end }} {{ if $commiturl }} {{ end }} - {{ else }} - {{ with $commiturl }} - - {{ end }} - - {{ if $commiturl }} - - {{ end }} + {{ with $commiturl }} + + {{ end }} + + + + {{ if $commiturl }} + {{ end }}

{{ end }}