Move paige.main.* params to paige

master
Will Faught 2 years ago
parent 42cf171da5
commit 42f8f041fd

@ -287,41 +287,40 @@ paige:
title: title:
class: "mb-0 text-center" class: "mb-0 text-center"
hide: false hide: false
main: metadata:
metadata: authors:
authors: class: "text-center text-secondary"
class: "text-center text-secondary"
hide: false
date:
class: "text-center text-secondary"
format: ":date_long" # Hugo date format
hide: false
description:
class: "lead text-center"
hide: false
git:
commit_url_prefix: "" # Example is "https://github.com/willfaught/paige/commit/"
max_width: ""
reading_time:
class: "text-center text-secondary"
hide: false
section:
class: "paige-metadata w-100"
terms:
hide: false
inner_class: "badge text-bg-secondary text-decoration-none"
outer_class: "text-center"
title:
class: "display-5 fw-bold text-center"
hide: false
table_of_contents:
class: "border mb-3 pe-3 ps-3 pt-3 rounded"
hide: false hide: false
max_width: "" date:
content: class: "text-center text-secondary"
class: "mw-100 paige-content" format: ":date_long" # Hugo date format
hide: false
description:
class: "lead text-center"
hide: false
git:
commit_url_prefix: "" # Example is "https://github.com/willfaught/paige/commit/"
max_width: ""
reading_time:
class: "text-center text-secondary"
hide: false
section:
class: "paige-metadata w-100"
terms:
hide: false
inner_class: "badge text-bg-secondary text-decoration-none"
outer_class: "text-center"
title:
class: "display-5 fw-bold text-center"
hide: false hide: false
max_width: "" table_of_contents:
class: "border mb-3 pe-3 ps-3 pt-3 rounded"
hide: false
max_width: ""
content:
class: "mw-100 paige-content"
hide: false
max_width: ""
math: false # Enable math typesetting math: false # Enable math typesetting
rss: rss:
hide_page: false hide_page: false

@ -8,10 +8,10 @@
{{ $listshowcontent = $params.listshowcontent }} {{ $listshowcontent = $params.listshowcontent }}
{{ end }} {{ end }}
{{ $class := $page.Param "paige.main.content.class" | default "mw-100 paige-content" }} {{ $class := $page.Param "paige.content.class" | default "mw-100 paige-content" }}
{{ $content := "" }} {{ $content := "" }}
{{ if $page.Param "paige.main.content.hide" | not }} {{ if $page.Param "paige.content.hide" | not }}
{{ $content = cond ($listshowcontent | not) ($page.Content | replaceRE `(<h[1-6] id="([^"]+)".+)(</h[1-6]+>)` (printf `${1}<a aria-label="%v" class="paige-header-link" href="#${2}">#</a>${3}` (i18n "paige_aria_section_link")) | safeHTML) $page.Content }} {{ $content = cond ($listshowcontent | not) ($page.Content | replaceRE `(<h[1-6] id="([^"]+)".+)(</h[1-6]+>)` (printf `${1}<a aria-label="%v" class="paige-header-link" href="#${2}">#</a>${3}` (i18n "paige_aria_section_link")) | safeHTML) $page.Content }}
{{ end }} {{ end }}

@ -8,29 +8,29 @@
{{ $listshowcontent = $params.listshowcontent }} {{ $listshowcontent = $params.listshowcontent }}
{{ end }} {{ end }}
{{ $authors := cond ($page.Param "paige.main.metadata.authors.hide" | not) (partial "paige/authors.html" $page) "" }} {{ $authors := cond ($page.Param "paige.metadata.authors.hide" | not) (partial "paige/authors.html" $page) "" }}
{{ $authorsclass := $page.Param "paige.main.metadata.authors.class" | default "paige-authors text-center text-secondary" }} {{ $authorsclass := $page.Param "paige.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 }} {{ $categories := cond ($page.Param "paige.metadata.terms.hide" | not) ($page.Params.categories | default slice) slice | uniq }}
{{ $commiturl := "" }} {{ $commiturl := "" }}
{{ $date := cond ($page.Param "paige.main.metadata.date.hide" | not) (cond (eq ($page.Param "paige.date" | default "published") "published") $page.PublishDate $page.Lastmod) "" }} {{ $date := cond ($page.Param "paige.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" }} {{ $dateclass := $page.Param "paige.metadata.date.class" | default "paige-date text-center text-secondary" }}
{{ $dateformat := $page.Param "paige.main.metadata.date.format" | default ":date_long" }} {{ $dateformat := $page.Param "paige.metadata.date.format" | default ":date_long" }}
{{ $description := cond ($page.Param "paige.main.metadata.description.hide" | not) ($page.Description | markdownify) "" }} {{ $description := cond ($page.Param "paige.metadata.description.hide" | not) ($page.Description | markdownify) "" }}
{{ $descriptionclass := $page.Param "paige.main.metadata.description.class" | default "lead paige-description text-center" }} {{ $descriptionclass := $page.Param "paige.metadata.description.class" | default "lead paige-description text-center" }}
{{ $nogap := "mb-0" }} {{ $nogap := "mb-0" }}
{{ $readingtime := cond ($page.Param "paige.main.metadata.reading_time.hide" | not) $page.ReadingTime "" }} {{ $readingtime := cond ($page.Param "paige.metadata.reading_time.hide" | not) $page.ReadingTime "" }}
{{ $readingtimeclass := $page.Param "paige.main.metadata.reading_time.class" | default "paige-reading-time text-center text-secondary" }} {{ $readingtimeclass := $page.Param "paige.metadata.reading_time.class" | default "paige-reading-time text-center text-secondary" }}
{{ $sectionclass := "paige-metadata w-100" }} {{ $sectionclass := "paige-metadata w-100" }}
{{ $tags := cond ($page.Param "paige.main.metadata.terms.hide" | not) ($page.Params.tags | default slice) slice | uniq }} {{ $tags := cond ($page.Param "paige.metadata.terms.hide" | not) ($page.Params.tags | default slice) slice | uniq }}
{{ $termsinnerclass := $page.Param "paige.main.metadata.terms.inner_class" | default "badge paige-terms-inner text-bg-secondary text-decoration-none" }} {{ $termsinnerclass := $page.Param "paige.metadata.terms.inner_class" | default "badge paige-terms-inner text-bg-secondary text-decoration-none" }}
{{ $termsouterclass := $page.Param "paige.main.metadata.terms.outer_class" | default "paige-terms-outer text-center" }} {{ $termsouterclass := $page.Param "paige.metadata.terms.outer_class" | default "paige-terms-outer text-center" }}
{{ $title := cond ($page.Param "paige.main.metadata.title.hide" | not) ($page.Title | markdownify) "" }} {{ $title := cond ($page.Param "paige.metadata.title.hide" | not) ($page.Title | markdownify) "" }}
{{ $titleclass := $page.Param "paige.main.metadata.title.class" | default "display-5 fw-bold paige-title text-center" }} {{ $titleclass := $page.Param "paige.metadata.title.class" | default "display-5 fw-bold paige-title text-center" }}
{{ $titlelink := $page.Params.link }} {{ $titlelink := $page.Params.link }}
{{ $titlepage := $page.RelPermalink }} {{ $titlepage := $page.RelPermalink }}
{{ if and ($page.Param "paige.main.metadata.git.commit_url_prefix") $page.GitInfo }} {{ if and ($page.Param "paige.metadata.git.commit_url_prefix") $page.GitInfo }}
{{ $commiturl = print ($page.Param "paige.main.metadata.git.commit_url_prefix") $page.GitInfo.Hash }} {{ $commiturl = print ($page.Param "paige.metadata.git.commit_url_prefix") $page.GitInfo.Hash }}
{{ end }} {{ end }}
<section {{ with $sectionclass }} class="{{ . }}" {{ end }}> <section {{ with $sectionclass }} class="{{ . }}" {{ end }}>

@ -49,8 +49,8 @@
{{ $titleclass := $page.Param "paige.list.title.class" | default "mb-0 paige-title text-center" }} {{ $titleclass := $page.Param "paige.list.title.class" | default "mb-0 paige-title text-center" }}
{{ $titlelink := .RelPermalink }} {{ $titlelink := .RelPermalink }}
{{ if and ($page.Param "paige.main.metadata.git.commit_url_prefix") $page.GitInfo }} {{ if and ($page.Param "paige.metadata.git.commit_url_prefix") $page.GitInfo }}
{{ $commiturl = print ($page.Param "paige.main.metadata.git.commit_url_prefix") $page.GitInfo.Hash }} {{ $commiturl = print ($page.Param "paige.metadata.git.commit_url_prefix") $page.GitInfo.Hash }}
{{ end }} {{ end }}
{{ if $draft }} {{ if $draft }}

@ -35,19 +35,19 @@ body, html {
margin-bottom: 0; margin-bottom: 0;
} }
{{ with $page.Param "paige.main.content.max_width" }} {{ with $page.Param "paige.content.max_width" }}
.paige-content { .paige-content {
max-width: {{ . }}; max-width: {{ . }};
} }
{{ end }} {{ end }}
{{ with $page.Param "paige.main.table_of_contents.max_width" }} {{ with $page.Param "paige.table_of_contents.max_width" }}
.paige-toc { .paige-toc {
max-width: {{ . }}; max-width: {{ . }};
} }
{{ end }} {{ end }}
{{ with $page.Param "paige.main.metadata.max_width" }} {{ with $page.Param "paige.metadata.max_width" }}
.paige-metadata { .paige-metadata {
max-width: {{ . }}; max-width: {{ . }};
} }

@ -8,9 +8,9 @@
{{ $listshowcontent = $params.listshowcontent }} {{ $listshowcontent = $params.listshowcontent }}
{{ end }} {{ end }}
{{ $class := $page.Param "paige.main.table_of_contents.class" | default "border mb-3 pe-3 ps-3 pt-3 rounded" }} {{ $class := $page.Param "paige.table_of_contents.class" | default "border mb-3 pe-3 ps-3 pt-3 rounded" }}
{{ if and $page.Content ($page.Param "paige.main.table_of_contents.hide" | not) (not $listshowcontent) (ne $page.TableOfContents `<nav id="TableOfContents"></nav>`) }} {{ if and $page.Content ($page.Param "paige.table_of_contents.hide" | not) (not $listshowcontent) (ne $page.TableOfContents `<nav id="TableOfContents"></nav>`) }}
<section class="paige-toc"> <section class="paige-toc">
{{ with $class }} {{ with $class }}
<div class="{{ . }}"> <div class="{{ . }}">

Loading…
Cancel
Save