diff --git a/README.md b/README.md index ce3e40f4..a1b60a72 100644 --- a/README.md +++ b/README.md @@ -266,6 +266,11 @@ paige: content_class: "fst-italic" # Page content class date_class: "text-center text-secondary" # Page date class description_class: "lead text-center" # Page description class + hide_authors: false # Hide the page authors (default is false) + hide_content: false # Hide the page authors (default is false) + hide_date: false # Hide the page date (default is false) + hide_description: false # Hide the page description (default is false) + hide_title: false # Hide the page title (default is false) title_class: "display-5 fw-bold text-center" # Page title class pages: # Page lists in list and term default layouts authors_class: "text-center text-secondary" # Page authors class attribute @@ -306,6 +311,11 @@ paige: content_class: "fst-italic" # Page content class date_class: "text-center text-secondary" # Page date class description_class: "lead text-center" # Page description class + hide_authors: false # Hide the page authors (default is false) + hide_content: false # Hide the page authors (default is false) + hide_date: false # Hide the page date (default is false) + hide_description: false # Hide the page description (default is false) + hide_title: false # Hide the page title (default is false) title_class: "display-5 fw-bold text-center" # Page title class toc: true # Show a table of contents if there are any headers ``` diff --git a/layouts/partials/paige/about.html b/layouts/partials/paige/about.html index b7b3b514..e384ac4c 100644 --- a/layouts/partials/paige/about.html +++ b/layouts/partials/paige/about.html @@ -1,7 +1,7 @@ -{{ $authors := partial "paige/func-authors.html" . }} +{{ $authors := cond (.Param "paige.page.hide_authors" | not | not) "" (partial "paige/func-authors.html" .) }} {{ $authorsclass := .Param "paige.page.authors_class" | default "text-center text-secondary" }} {{ $gap := "mb-0" }} -{{ $date := .PublishDate }} +{{ $date := cond (.Param "paige.page.hide_date" | not | not) "" .PublishDate }} {{ $dateclass := .Param "paige.page.date_class" | default "text-center text-secondary" }} {{ with $authors }} diff --git a/layouts/partials/paige/content.html b/layouts/partials/paige/content.html index f9fd4f26..58fb8229 100644 --- a/layouts/partials/paige/content.html +++ b/layouts/partials/paige/content.html @@ -1,17 +1,8 @@ -{{ if .Content }} - {{ $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 `()` `${1}#${3}` | safeHTML) }} -
- {{ with $class }} -
- {{ end }} - {{ if .Scratch.Get "paige_show_full_pages" }} - {{ .Content }} - {{ else }} - {{ .Content | replaceRE `()` `${1}#${3}` | safeHTML }} - {{ end }} - {{ if $class }} -
- {{ end }} +{{ with $content }} +
+ {{ . }}
{{ end }} diff --git a/layouts/partials/paige/description.html b/layouts/partials/paige/description.html index 59074197..5fde675f 100644 --- a/layouts/partials/paige/description.html +++ b/layouts/partials/paige/description.html @@ -1,5 +1,6 @@ -{{ with .Description }} - {{ $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) }} -

{{ . | markdownify }}

+{{ with $description }} +

{{ . }}

{{ end }} diff --git a/layouts/partials/paige/title.html b/layouts/partials/paige/title.html index 55ca0860..7e466673 100644 --- a/layouts/partials/paige/title.html +++ b/layouts/partials/paige/title.html @@ -1,6 +1,6 @@ -{{ if .Title }} - {{ $class := .Param "paige.page.title_class" | default "display-5 fw-bold text-center" }} - {{ $title := .Title | markdownify }} +{{ $class := .Param "paige.page.title_class" | default "display-5 fw-bold text-center" }} +{{ $title := cond (.Param "paige.page.hide_title" | not | not) "" (.Title | markdownify) }} +{{ if $title }}

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

{{ end }}