Replace some page config prefixes with nesting

master
Will Faught 2 years ago
parent 388b7d757a
commit 2c4f4324ff

@ -261,28 +261,41 @@ paige:
menu_breakpoint: "sm" # Bootstrap breakpoint at which to display all menu items menu_breakpoint: "sm" # Bootstrap breakpoint at which to display all menu items
menu_style: "pills" # Menu item style; must be "links" or "pills"; default is "pills" menu_style: "pills" # Menu item style; must be "links" or "pills"; default is "pills"
metadata_max_width: "100ch" # Page metadata max width metadata_max_width: "100ch" # Page metadata max width
page: # Every page page:
authors_class: "text-center text-secondary" # Page authors class authors:
content_class: "fst-italic" # Page content class class: "text-center text-secondary" # Default is "text-center text-secondary"
date_class: "text-center text-secondary" # Page date class hide: false # Default is false
description_class: "lead text-center" # Page description class content:
hide_authors: false # Hide the page authors (default is false) class: "" # Default is ""
hide_content: false # Hide the page authors (default is false) hide: false # Default is false
hide_date: false # Hide the page date (default is false) date:
hide_description: false # Hide the page description (default is false) class: "text-center text-secondary" # Default is "text-center text-secondary"
hide_title: false # Hide the page title (default is false) hide: false # Default is false
title_class: "display-5 fw-bold text-center" # Page title class description:
class: "lead text-center" # Default is "lead text-center"
hide: false # Default is false
title:
class: "display-5 fw-bold text-center" # Default is "display-5 fw-bold text-center"
hide: false # Default is false
pages: # Page lists in list and term default layouts pages: # Page lists in list and term default layouts
authors_class: "text-center text-secondary" # Page authors class attribute authors:
date_class: "text-center text-secondary" # Page date class attribute class: "text-center text-secondary" # Default is "text-center text-secondary"
description_class: "text-center" # Page description class attribute show: false # Default is false
header_class: "h5 text-center" # Month and year header class attribute date:
hide_description: false # Hide the page description (default is true) class: "text-center text-secondary" # Default is "text-center text-secondary"
show_authors: false # Show the page authors (default is false) show: false # Default is false
show_date: false # Show the page date (default is false) description:
show_summary: false # Show the page summary (default is false) class: "text-center" # Default is "text-center"
summary_class: "text-center" # Page summary class attribute hide: false # Default is false
title_class: "text-center" # Page title class attribute header:
class: "h5 text-center" # Month and year header class attribute
hide: false # Default is false
summary:
class: "text-center" # Default is "text-center"
show: false # Default is false
title:
class: "text-center" # Default is "text-center"
hide: false # Default is false
rss: rss:
managing_editor: "Michael Bluth" managing_editor: "Michael Bluth"
web_master: "Michael Bluth" web_master: "Michael Bluth"
@ -307,16 +320,21 @@ link: "https://youtu.be/dQw4w9WgXcQ" # The reference for an anchor around the ti
paige: paige:
math: true # Enable math typesetting with KaTeX math: true # Enable math typesetting with KaTeX
page: page:
authors_class: "text-center text-secondary" # Page authors class authors:
content_class: "fst-italic" # Page content class class: "text-center text-secondary" # Default is "text-center text-secondary"
date_class: "text-center text-secondary" # Page date class hide: false # Default is false
description_class: "lead text-center" # Page description class content:
hide_authors: false # Hide the page authors (default is false) class: "" # Default is ""
hide_content: false # Hide the page authors (default is false) hide: false # Default is false
hide_date: false # Hide the page date (default is false) date:
hide_description: false # Hide the page description (default is false) class: "text-center text-secondary" # Default is "text-center text-secondary"
hide_title: false # Hide the page title (default is false) hide: false # Default is false
title_class: "display-5 fw-bold text-center" # Page title class description:
class: "lead text-center" # Default is "lead text-center"
hide: false # Default is false
title:
class: "display-5 fw-bold text-center" # Default is "display-5 fw-bold text-center"
hide: false # Default is false
toc: true # Show a table of contents if there are any headers toc: true # Show a table of contents if there are any headers
``` ```
@ -334,17 +352,25 @@ Additional optional list page parameters:
```yaml ```yaml
paige: paige:
pages: # Page list page_list:
authors_class: "text-center text-secondary" # Page authors class attribute authors:
date_class: "text-center text-secondary" # Page date class attribute class: "text-center text-secondary" # Default is "text-center text-secondary"
description_class: "text-center" # Page description class attribute show: false # Default is false
header_class: "h5 text-center" # Month and year header class attribute date:
hide_description: false # Hide the page description (default is true) class: "text-center text-secondary" # Default is "text-center text-secondary"
show_authors: false # Show the page authors (default is false) show: false # Default is false
show_date: false # Show the page date (default is false) description:
show_summary: false # Show the page summary (default is false) class: "text-center" # Default is "text-center"
summary_class: "text-center" # Page summary class attribute hide: false # Default is false
title_class: "text-center" # Page title class attribute header:
class: "h5 text-center" # Month and year header class attribute
hide: false # Default is false
summary:
class: "text-center" # Default is "text-center"
show: false # Default is false
title:
class: "text-center" # Default is "text-center"
hide: false # Default is false
show_full_pages: true # Show full pages, not just page titles and descriptions show_full_pages: true # Show full pages, not just page titles and descriptions
``` ```

@ -1,8 +1,8 @@
{{ $authors := cond (.Param "paige.page.hide_authors" | not | not) "" (partial "paige/func-authors.html" .) }} {{ $authors := cond (.Param "paige.page.authors.hide" | not) (partial "paige/func-authors.html" .) "" }}
{{ $authorsclass := .Param "paige.page.authors_class" | default "text-center text-secondary" }} {{ $authorsclass := .Param "paige.page.authors.class" | default "text-center text-secondary" }}
{{ $gap := "mb-0" }} {{ $gap := "mb-0" }}
{{ $date := cond (.Param "paige.page.hide_date" | not | not) "" .PublishDate }} {{ $date := cond (.Param "paige.page.date.hide" | not) .PublishDate "" }}
{{ $dateclass := .Param "paige.page.date_class" | default "text-center text-secondary" }} {{ $dateclass := .Param "paige.page.date.class" | default "text-center text-secondary" }}
{{ with $authors }} {{ with $authors }}
<p class="{{ if $date }} {{ $gap }} {{ end }} {{ $authorsclass }}">{{ . }}</p> <p class="{{ if $date }} {{ $gap }} {{ end }} {{ $authorsclass }}">{{ . }}</p>

@ -1,5 +1,9 @@
{{ $class := .Param "paige.page.content_class" }} {{ $class := .Param "paige.page.content.class" }}
{{ $content := cond (.Scratch.Get "paige_show_full_pages" | not | not) .Content (.Content | replaceRE `(<h[1-6] id="([^"]+)".+)(</h[1-6]+>)` `${1}<a aria-label="Link to this section" class="paige-header-link" href="#${2}">#</a>${3}` | safeHTML) }} {{ $content := "" }}
{{ if .Param "paige.page.title.hide" | not }}
{{ $content = cond (.Scratch.Get "paige_show_full_pages" | not | not) .Content (.Content | replaceRE `(<h[1-6] id="([^"]+)".+)(</h[1-6]+>)` `${1}<a aria-label="Link to this section" class="paige-header-link" href="#${2}">#</a>${3}` | safeHTML) }}
{{ end }}
{{ with $content }} {{ with $content }}
<section class="paige-content {{ with $class }} {{ . }} {{ end }}"> <section class="paige-content {{ with $class }} {{ . }} {{ end }}">

@ -1,5 +1,5 @@
{{ $class := .Param "paige.page.description_class" | default "lead text-center" }} {{ $class := .Param "paige.page.description.class" | default "lead text-center" }}
{{ $description := cond (.Param "paige.page.hide_description" | not | not) "" (.Description | markdownify) }} {{ $description := cond (.Param "paige.page.description.hide" | not) (.Description | markdownify) "" }}
{{ with $description }} {{ with $description }}
<p class="{{ $class }}">{{ . }}</p> <p class="{{ $class }}">{{ . }}</p>

@ -18,21 +18,23 @@
{{ $p := .Paginate (.Pages.ByDate.Reverse.GroupByDate "January 2006") }} {{ $p := .Paginate (.Pages.ByDate.Reverse.GroupByDate "January 2006") }}
<section> <section>
{{ range $p.PageGroups }} {{ range $p.PageGroups }}
<h2 class="{{ $.Param `paige.pages.header_class` | default `h5 text-center` }}">{{ .Key }}</h2> {{ if $.Param "paige.pages.header.hide" | not }}
<h2 class="{{ $.Param `paige.pages.header.class` | default `h5 text-center` }}">{{ .Key }}</h2>
{{ end }}
{{ range .Pages }} {{ range .Pages }}
{{ $class := "text-center" }} {{ $class := "text-center" }}
{{ $authors := cond ($.Param "paige.pages.show_authors" | not | not) (partial "paige/func-authors.html" .) "" }} {{ $authors := cond ($.Param "paige.pages.authors.show" | not) "" (partial "paige/func-authors.html" .) }}
{{ $authorsclass := $.Param "paige.pages.authors_class" | default (print $class " text-secondary") }} {{ $authorsclass := $.Param "paige.pages.authors.class" | default (print $class " text-secondary") }}
{{ $date := cond ($.Param "paige.pages.show_date" | not | not) .PublishDate "" }} {{ $date := cond ($.Param "paige.pages.date.show" | not) "" .PublishDate }}
{{ $dateclass := $.Param "paige.pages.date_class" | default (print $class " text-secondary") }} {{ $dateclass := $.Param "paige.pages.date.class" | default (print $class " text-secondary") }}
{{ $description := cond ($.Param "paige.pages.hide_description" | not) (.Description | markdownify) "" }} {{ $description := cond ($.Param "paige.pages.description.hide" | not) (.Description | markdownify) "" }}
{{ $descriptionclass := $.Param "paige.pages.description_class" | default $class }} {{ $descriptionclass := $.Param "paige.pages.description.class" | default $class }}
{{ $flags := slice }} {{ $flags := slice }}
{{ $gap := "mb-0" }} {{ $gap := "mb-0" }}
{{ $summary := cond ($.Param "paige.pages.show_summary" | not | not) (.Summary | strings.TrimPrefix "<p>" | strings.TrimSuffix "</p>") "" }} {{ $summary := cond ($.Param "paige.pages.summary.show" | not) "" (.Summary | strings.TrimPrefix "<p>" | strings.TrimSuffix "</p>") }}
{{ $summaryclass := $.Param "paige.pages.summary_class" | default $class }} {{ $summaryclass := $.Param "paige.pages.summary.class" | default $class }}
{{ $title := .Title | markdownify }} {{ $title := cond ($.Param "paige.pages.title.hide" | not) (.Title | markdownify) "" }}
{{ $titleclass := $.Param "paige.pages.title_class" | default $class }} {{ $titleclass := $.Param "paige.pages.title_class" | default $class }}
{{ if .Draft }} {{ if .Draft }}

@ -1,5 +1,5 @@
{{ $class := .Param "paige.page.title_class" | default "display-5 fw-bold text-center" }} {{ $class := .Param "paige.page.title.class" | default "display-5 fw-bold text-center" }}
{{ $title := cond (.Param "paige.page.hide_title" | not | not) "" (.Title | markdownify) }} {{ $title := cond (.Param "paige.page.title.hide" | not) (.Title | markdownify) "" }}
{{ if $title }} {{ if $title }}
<h1 class="{{ $class }}">{{ if .Params.link }}<a href="{{ .Params.link }}">{{ $title }}</a>{{ else }}{{ $title }}{{ end }}{{ if .Scratch.Get "paige_show_full_pages" }}<a aria-label="Link to this section" class="paige-header-link" href="{{ .RelPermalink }}">#</a>{{ end }}</h1> <h1 class="{{ $class }}">{{ if .Params.link }}<a href="{{ .Params.link }}">{{ $title }}</a>{{ else }}{{ $title }}{{ end }}{{ if .Scratch.Get "paige_show_full_pages" }}<a aria-label="Link to this section" class="paige-header-link" href="{{ .RelPermalink }}">#</a>{{ end }}</h1>

Loading…
Cancel
Save