From 226d4129f22859b59e299ed1714c3e96de59968f Mon Sep 17 00:00:00 2001 From: Will Faught Date: Sat, 4 Feb 2023 21:15:40 -0800 Subject: [PATCH] Rename paige.show_full_pages to paige.page_list.content.show --- README.md | 5 ++++- layouts/_default/list.html | 2 +- layouts/partials/paige/content.html | 2 +- layouts/partials/paige/links.html | 2 +- layouts/partials/paige/metadata.html | 2 +- layouts/partials/paige/pages.html | 4 ++-- layouts/partials/paige/scripts.html | 2 +- layouts/partials/paige/toc.html | 2 +- 8 files changed, 12 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 107c9bba..78909a81 100644 --- a/README.md +++ b/README.md @@ -293,6 +293,8 @@ paige: categories: class: "badge text-bg-secondary text-decoration-none" # Default is "badge text-bg-secondary text-decoration-none" hide: false # Default is false + content: + show: false # Default is false date: class: "text-center text-secondary" # Default is "text-center text-secondary" format: ":date_long" # Default is ":date_long" @@ -375,6 +377,8 @@ paige: authors: class: "text-center text-secondary" # Default is "text-center text-secondary" show: false # Default is false + content: + show: false # Default is false date: class: "text-center text-secondary" # Default is "text-center text-secondary" show: false # Default is false @@ -390,7 +394,6 @@ paige: 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 ``` Additional optional single page parameters: diff --git a/layouts/_default/list.html b/layouts/_default/list.html index c871c2eb..24d26ef5 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,7 +1,7 @@ {{ define "main" }} {{ $page := . }} -{{ if $page.Param "paige.show_full_pages" | not }} +{{ if $page.Param "paige.page_list.content.show" | not }} {{ partial "paige/article.html" $page }} {{ end }} {{ partial "paige/pages.html" $page }} diff --git a/layouts/partials/paige/content.html b/layouts/partials/paige/content.html index a180e331..e536d94f 100644 --- a/layouts/partials/paige/content.html +++ b/layouts/partials/paige/content.html @@ -4,7 +4,7 @@ {{ $content := "" }} {{ if $page.Param "paige.page.title.hide" | not }} - {{ $content = cond ($page.Scratch.Get "paige_show_full_pages" | not) ($page.Content | replaceRE `()` `${1}#${3}` | safeHTML) $page.Content }} + {{ $content = cond ($page.Scratch.Get "paige_list_show_content" | not) ($page.Content | replaceRE `()` `${1}#${3}` | safeHTML) $page.Content }} {{ end }} {{ with $content }} diff --git a/layouts/partials/paige/links.html b/layouts/partials/paige/links.html index 71b9d919..40cbf561 100644 --- a/layouts/partials/paige/links.html +++ b/layouts/partials/paige/links.html @@ -20,7 +20,7 @@ "integrity" ($page.Param "paige.bootstrap.style.link_integrity") "raw" ($page.Param "paige.bootstrap.style.raw") ) }} -{{ if or ($page.Param "paige.math") (and ($page.Param "paige.show_full_pages") (where $page.Pages "Params.paige.math" "eq" true)) }} +{{ if or ($page.Param "paige.math") (and ($page.Param "paige.page_list.content.show") (where $page.Pages "Params.paige.math" "eq" true)) }} {{ partial "paige/link.html" (dict "href" ($page.Param "paige.math.style.link_href" | default "https://cdn.jsdelivr.net/npm/katex@0.16.3/dist/katex.min.css") "integrity" ($page.Param "paige.math.style.link_integrity" | default "sha256-NJNVfEC6jfEt62wQMafLNT2eI6BaWONXbpkSEVAs3+8=") diff --git a/layouts/partials/paige/metadata.html b/layouts/partials/paige/metadata.html index bcbd3523..af8be600 100644 --- a/layouts/partials/paige/metadata.html +++ b/layouts/partials/paige/metadata.html @@ -22,7 +22,7 @@
{{ with $title }} -

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

+

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

{{ end }} {{ with $description }} diff --git a/layouts/partials/paige/pages.html b/layouts/partials/paige/pages.html index be914d91..9cb87780 100644 --- a/layouts/partials/paige/pages.html +++ b/layouts/partials/paige/pages.html @@ -3,11 +3,11 @@ {{ $class := "mb-0 text-center" }} {{ if $page.Pages }} - {{ if $page.Param "paige.show_full_pages" }} + {{ if $page.Param "paige.page_list.content.show" }} {{ $p := $page.Paginate $page.Pages }}
{{ range $p.Pages }} - {{ $page.Scratch.Set "paige_show_full_pages" true }} + {{ $page.Scratch.Set "paige_list_show_content" true }} {{ partial "paige/article.html" . }} {{ end }}
diff --git a/layouts/partials/paige/scripts.html b/layouts/partials/paige/scripts.html index 0e2491c3..6cc4ebc4 100644 --- a/layouts/partials/paige/scripts.html +++ b/layouts/partials/paige/scripts.html @@ -53,7 +53,7 @@ addEventListener("resize", paigeResize); "raw" ($page.Param "paige.bootstrap.script.raw") "src" ($page.Param "paige.bootstrap.script.script_src" | default "https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js") ) }} -{{ if or ($page.Param "paige.math") (and ($page.Param "paige.show_full_pages") (where $page.Pages "Params.paige.math" "eq" true)) }} +{{ if or ($page.Param "paige.math") (and ($page.Param "paige.page_list.content.show") (where $page.Pages "Params.paige.math" "eq" true)) }} {{ partial "paige/script.html" (dict "integrity" ($page.Param "paige.math.script.script_integrity") "raw" ($page.Param "paige.math.script.raw") diff --git a/layouts/partials/paige/toc.html b/layouts/partials/paige/toc.html index 9a12417b..20b71434 100644 --- a/layouts/partials/paige/toc.html +++ b/layouts/partials/paige/toc.html @@ -1,6 +1,6 @@ {{ $page := . }} -{{ if and $page.Content ($page.Param "paige.toc") (not (eq ($page.Scratch.Get "paige_show_full_pages") true)) (ne $page.TableOfContents ``) }} +{{ if and $page.Content ($page.Param "paige.toc") (not (eq ($page.Scratch.Get "paige_list_show_content") true)) (ne $page.TableOfContents ``) }}
{{ $page.TableOfContents }}