diff --git a/README.md b/README.md index a330620b..63ec47f5 100644 --- a/README.md +++ b/README.md @@ -296,7 +296,7 @@ paige: date: class: "text-center text-secondary" # Default is "text-center text-secondary" format: ":date_long" # Default is ":date_long" - show: false # Default is false + hide: true # Default is true date_header: class: "h5 text-center" # Month and year header class attribute hide: false # Default is false @@ -876,12 +876,11 @@ For example, the default layouts `home.html`, `list.html`, `single.html`, `taxonomy.html`, and `term.html` include the partial template `paige/article.html`. `paige/article.html` includes the partial templates `paige/metadata.html`, `paige/toc.html`, and `paige/content.html`. -`paige/metadata.html` includes the partial templates `paige/title.html`, `paige/description.html`, and `paige/other.html`. -To change the page title for those default layouts, change `paige/title.html`. +To change the page title for those default layouts, change `paige/metadata.html`. To change the page title for `single.html`, replace the use of `paige/article.html` in `single.html` with the use of -`paige/title.html`, `paige/description.html`, `paige/other.html`, `paige/toc.html`, and `paige/content.html`, -then replace that use of `paige/title.html` with your own design. +`paige/metadata.html`, `paige/toc.html`, and `paige/content.html`, +then replace that use of `paige/metadata.html` with your own design. ### Define diff --git a/layouts/partials/paige/about.html b/layouts/partials/paige/about.html deleted file mode 100644 index f4988d3e..00000000 --- a/layouts/partials/paige/about.html +++ /dev/null @@ -1,39 +0,0 @@ -{{ $page := . }} - -{{ $authors := cond ($page.Param "paige.page.authors.hide" | not) (partial "paige/func-authors.html" $page) "" }} -{{ $authorsclass := $page.Param "paige.page.authors.class" | default "text-center text-secondary" }} -{{ $categories := cond ($page.Param "paige.page.terms.show" | not) slice ($page.Params.categories | default slice) | sort | uniq }} -{{ $date := cond ($page.Param "paige.page.date.hide" | not) $page.PublishDate "" }} -{{ $dateclass := $page.Param "paige.page.date.class" | default "text-center text-secondary" }} -{{ $gap := "mb-0" }} -{{ $readingtime := $page.Param "paige.page.reading_time.show" }} -{{ $readingtimeclass := $page.Param "paige.page.reading_time.class" | default "text-center text-secondary" }} -{{ $tags := cond ($page.Param "paige.page.terms.show" | not) slice ($page.Params.tags | default slice) | sort | uniq }} -{{ $termsinnerclass := $page.Param "paige.page.terms.inner_class" | default "badge text-bg-secondary text-decoration-none" }} -{{ $termsouterclass := $page.Param "paige.page.terms.outer_class" | default "text-center" }} - -{{ if or $categories $tags }} -

- {{ $terms := slice }} - {{ range $categories }} - {{ $terms = $terms | append (dict "name" . "url" (lower . | printf "categories/%v/" | relLangURL)) }} - {{ end }} - {{ range $tags }} - {{ $terms = $terms | append (dict "name" . "url" (lower . | printf "tags/%v/" | relLangURL)) }} - {{ end }} - {{ range sort $terms "name" }} - {{ .name }} - {{ end }} -

-{{ end }} -{{ with $authors }} -

{{ . }}

-{{ end }} -{{ with $date }} -

- -

-{{ end }} -{{ if $readingtime }} -

{{ $page.ReadingTime }} {{ i18n "paige_minutes" $page.ReadingTime }}

-{{ end }} diff --git a/layouts/partials/paige/description.html b/layouts/partials/paige/description.html deleted file mode 100644 index 7d0bef70..00000000 --- a/layouts/partials/paige/description.html +++ /dev/null @@ -1,8 +0,0 @@ -{{ $page := . }} - -{{ $class := $page.Param "paige.page.description.class" | default "lead text-center" }} -{{ $description := cond ($page.Param "paige.page.description.hide" | not) ($page.Description | markdownify) "" }} - -{{ with $description }} -

{{ . }}

-{{ end }} diff --git a/layouts/partials/paige/metadata.html b/layouts/partials/paige/metadata.html index 377d39d2..bcd8249d 100644 --- a/layouts/partials/paige/metadata.html +++ b/layouts/partials/paige/metadata.html @@ -1,7 +1,63 @@ {{ $page := . }} -
- {{ partial "paige/title.html" $page }} - {{ partial "paige/description.html" $page }} - {{ partial "paige/about.html" $page }} +{{ $authors := cond ($page.Param "paige.page.authors.hide" | not) (partial "paige/func-authors.html" $page) "" }} +{{ $authorsclass := $page.Param "paige.page.authors.class" | default "text-center text-secondary" }} +{{ $categories := cond ($page.Param "paige.page.terms.show" | not) slice ($page.Params.categories | default slice) | sort | uniq }} +{{ $date := cond ($page.Param "paige.page.date.hide" | not) $page.PublishDate "" }} +{{ $dateclass := $page.Param "paige.page.date.class" | default "text-center text-secondary" }} +{{ $dateformat := $page.Param "paige.page.date.format" | default ":date_long" }} +{{ $description := cond ($page.Param "paige.page.description.hide" | not) ($page.Description | markdownify) "" }} +{{ $descriptionclass := $page.Param "paige.page.description.class" | default "lead text-center" }} +{{ $nogap := "mb-0" }} +{{ $readingtime := cond ($page.Param "paige.page.reading_time.show" | not) "" $page.ReadingTime }} +{{ $readingtimeclass := $page.Param "paige.page.reading_time.class" | default "text-center text-secondary" }} +{{ $sectionclass := "paige-metadata w-100" }} +{{ $tags := cond ($page.Param "paige.page.terms.show" | not) slice ($page.Params.tags | default slice) | sort | uniq }} +{{ $termsinnerclass := $page.Param "paige.page.terms.inner_class" | default "badge text-bg-secondary text-decoration-none" }} +{{ $termsouterclass := $page.Param "paige.page.terms.outer_class" | default "text-center" }} +{{ $title := cond ($page.Param "paige.page.title.hide" | not) ($page.Title | markdownify) "" }} +{{ $titleclass := $page.Param "paige.page.title.class" | default "display-5 fw-bold text-center" }} +{{ $titlelink := $page.Params.link }} +{{ $titlepage := $page.RelPermalink }} + +
+ {{ with $title }} +

{{ with $titlelink }}{{ . }}{{ else }}{{ . }}{{ end }}{{ if $page.Scratch.Get "paige_show_full_pages" }}#{{ end }}

+ {{ end }} + + {{ with $description }} +

{{ . }}

+ {{ end }} + + {{ if or $categories $tags }} +

+ {{ $terms := slice }} + + {{ range $categories }} + {{ $terms = $terms | append (dict "name" . "url" (lower . | printf "categories/%v/" | relLangURL)) }} + {{ end }} + + {{ range $tags }} + {{ $terms = $terms | append (dict "name" . "url" (lower . | printf "tags/%v/" | relLangURL)) }} + {{ end }} + + {{ range sort $terms "name" }} + {{ .name }} + {{ end }} +

+ {{ end }} + + {{ with $authors }} +

{{ . }}

+ {{ end }} + + {{ with $date }} +

+ +

+ {{ end }} + + {{ with $readingtime }} +

{{ . }} {{ i18n "paige_minutes" . }}

+ {{ end }}
diff --git a/layouts/partials/paige/pages.html b/layouts/partials/paige/pages.html index 5923263f..c446ce83 100644 --- a/layouts/partials/paige/pages.html +++ b/layouts/partials/paige/pages.html @@ -1,12 +1,14 @@ {{ $page := . }} +{{ $class := "mb-0 text-center" }} + {{ if $page.Pages }} {{ if $page.Param "paige.show_full_pages" }} {{ $p := $page.Paginate $page.Pages }}
{{ range $p.Pages }} {{ $page.Scratch.Set "paige_show_full_pages" true }} - {{ partial "paige/article.html" $page }} + {{ partial "paige/article.html" . }} {{ end }}
{{ if or $p.HasPrev $p.HasNext }} @@ -24,79 +26,95 @@

{{ .Key }}

{{ end }} {{ range .Pages }} - {{ $class := "text-center" }} - {{ $authors := cond ($page.Param "paige.page_list.authors.show" | not) "" (partial "paige/func-authors.html" .) }} {{ $authorsclass := $page.Param "paige.page_list.authors.class" | default (print $class " text-secondary") }} - {{ $categories := cond ($page.Param "paige.page_list.categories.show" | not) slice (.Params.categories | default slice) | sort | uniq }} - {{ $categoriesclass := $page.Param "paige.page_list.categories.class" | default "badge text-bg-secondary text-decoration-none" }} + {{ $categories := cond ($page.Param "paige.page_list.terms.show" | not) slice (.Params.categories | default slice) | sort | uniq }} {{ $date := cond ($page.Param "paige.page_list.date.show" | not) "" .PublishDate }} {{ $dateclass := $page.Param "paige.page_list.date.class" | default (print $class " text-secondary") }} + {{ $dateformat := $page.Param "paige.page_list.date.format" | default ":date_long" }} {{ $description := cond ($page.Param "paige.page_list.description.hide" | not) (.Description | markdownify) "" }} {{ $descriptionclass := $page.Param "paige.page_list.description.class" | default $class }} + {{ $draft := .Draft }} + {{ $expired := and .ExpiryDate (lt .ExpiryDate now) }} {{ $flags := slice }} - {{ $gap := "mb-0" }} - {{ $readingtime := $page.Param "paige.page_list.reading_time.show" }} - {{ $readingtimeclass := $page.Param "paige.page_list.reading_time.class" | default "text-center text-secondary" }} + {{ $future := and .PublishDate (gt .PublishDate now) }} + {{ $modified := and .PublishDate .Lastmod (lt .PublishDate .Lastmod) }} + {{ $readingtime := cond ($page.Param "paige.page_list.reading_time.show" | not) "" .ReadingTime }} + {{ $readingtimeclass := $page.Param "paige.page_list.reading_time.class" | default (print $class " text-secondary") }} + {{ $sectionclass := $page.Param "paige.page_list.section.class" | default "mb-3 w-100" }} {{ $summary := cond ($page.Param "paige.page_list.summary.show" | not) "" (.Summary | strings.TrimPrefix "

" | strings.TrimSuffix "

") }} {{ $summaryclass := $page.Param "paige.page_list.summary.class" | default $class }} - {{ $tags := cond ($page.Param "paige.page_list.tags.show" | not) slice (.Params.tags | default slice) | sort | uniq }} - {{ $tagsclass := $page.Param "paige.page_list.tags.class" | default "badge text-bg-secondary text-decoration-none" }} + {{ $tags := cond ($page.Param "paige.page_list.terms.show" | not) slice (.Params.tags | default slice) | sort | uniq }} + {{ $termsinnerclass := $page.Param "paige.page_list.terms.inner_class" | default "badge text-bg-secondary text-decoration-none" }} + {{ $termsouterclass := $page.Param "paige.page_list.terms.outer_class" | default $class }} {{ $title := cond ($page.Param "paige.page_list.title.hide" | not) (.Title | markdownify) "" }} {{ $titleclass := $page.Param "paige.page_list.title.class" | default $class }} + {{ $titlelink := .RelPermalink }} - {{ if .Draft }} + {{ if $draft }} {{ $flags = $flags | append "paige-draft" "paige-unpublished" }} {{ end }} - {{ if and .ExpiryDate (lt .ExpiryDate now) }} + {{ if $expired }} {{ $flags = $flags | append "paige-expired" "paige-unpublished" }} {{ end }} - {{ if and .PublishDate (gt .PublishDate now) }} + {{ if $future }} {{ $flags = $flags | append "paige-future" "paige-unpublished" }} {{ end }} - {{ if and .PublishDate .Lastmod (lt .PublishDate .Lastmod) }} + {{ if $modified }} {{ $flags = $flags | append "paige-modified" }} {{ end }} {{ $flags = delimit ($flags | sort | uniq) " " }} + {{ $sectionclass = delimit (split $sectionclass " " | append $flags | sort | uniq) " " }} -

- {{ $title | markdownify }} -

- {{ with $description }} -

{{ . }}

- {{ end }} - {{ with $authors }} -

{{ . }}

- {{ end }} - {{ if $date }} -

- -

- {{ end }} - {{ if $readingtime }} -

{{ .ReadingTime }} {{ i18n "paige_minutes" .ReadingTime }}

- {{ end }} - {{ with $categories }} -

- {{ range . }} - {{ . }} - {{ end }} -

- {{ end }} - {{ with $tags }} -

- {{ range . }} - {{ . }} - {{ end }} -

- {{ end }} - {{ if $summary }} -

{{ $summary }}

- {{ end }} +
+ {{ with $title }} +

{{ . }}

+ {{ end }} + + {{ with $description }} +

{{ . }}

+ {{ end }} + + {{ if or $categories $tags }} +

+ {{ $terms := slice }} + + {{ range $categories }} + {{ $terms = $terms | append (dict "name" . "url" (lower . | printf "categories/%v/" | relLangURL)) }} + {{ end }} + + {{ range $tags }} + {{ $terms = $terms | append (dict "name" . "url" (lower . | printf "tags/%v/" | relLangURL)) }} + {{ end }} + + {{ range sort $terms "name" }} + {{ .name }} + {{ end }} +

+ {{ end }} + + {{ with $authors }} +

{{ . }}

+ {{ end }} + + {{ with $date }} +

+ +

+ {{ end }} + + {{ with $readingtime }} +

{{ . }} {{ i18n "paige_minutes" . }}

+ {{ end }} + + {{ with $summary }} +

{{ . }}

+ {{ end }} +
{{ end }} {{ end }}
diff --git a/layouts/partials/paige/title.html b/layouts/partials/paige/title.html deleted file mode 100644 index afd67d13..00000000 --- a/layouts/partials/paige/title.html +++ /dev/null @@ -1,8 +0,0 @@ -{{ $page := . }} - -{{ $class := $page.Param "paige.page.title.class" | default "display-5 fw-bold text-center" }} -{{ $title := cond ($page.Param "paige.page.title.hide" | not) ($page.Title | markdownify) "" }} - -{{ if $title }} -

{{ with $page.Params.link }}{{ $title }}{{ else }}{{ $title }}{{ end }}{{ if $page.Scratch.Get "paige_show_full_pages" }}#{{ end }}

-{{ end }}