Rename paige.show_full_pages to paige.page_list.content.show

master
Will Faught 2 years ago
parent 91865e3ade
commit 226d4129f2

@ -293,6 +293,8 @@ paige:
categories: categories:
class: "badge text-bg-secondary text-decoration-none" # Default is "badge text-bg-secondary text-decoration-none" class: "badge text-bg-secondary text-decoration-none" # Default is "badge text-bg-secondary text-decoration-none"
hide: false # Default is false hide: false # Default is false
content:
show: false # Default is false
date: date:
class: "text-center text-secondary" # Default is "text-center text-secondary" class: "text-center text-secondary" # Default is "text-center text-secondary"
format: ":date_long" # Default is ":date_long" format: ":date_long" # Default is ":date_long"
@ -375,6 +377,8 @@ paige:
authors: authors:
class: "text-center text-secondary" # Default is "text-center text-secondary" class: "text-center text-secondary" # Default is "text-center text-secondary"
show: false # Default is false show: false # Default is false
content:
show: false # Default is false
date: date:
class: "text-center text-secondary" # Default is "text-center text-secondary" class: "text-center text-secondary" # Default is "text-center text-secondary"
show: false # Default is false show: false # Default is false
@ -390,7 +394,6 @@ paige:
title: title:
class: "text-center" # Default is "text-center" class: "text-center" # Default is "text-center"
hide: false # Default is false hide: false # Default is false
show_full_pages: true # Show full pages, not just page titles and descriptions
``` ```
Additional optional single page parameters: Additional optional single page parameters:

@ -1,7 +1,7 @@
{{ define "main" }} {{ define "main" }}
{{ $page := . }} {{ $page := . }}
{{ if $page.Param "paige.show_full_pages" | not }} {{ if $page.Param "paige.page_list.content.show" | not }}
{{ partial "paige/article.html" $page }} {{ partial "paige/article.html" $page }}
{{ end }} {{ end }}
{{ partial "paige/pages.html" $page }} {{ partial "paige/pages.html" $page }}

@ -4,7 +4,7 @@
{{ $content := "" }} {{ $content := "" }}
{{ if $page.Param "paige.page.title.hide" | not }} {{ if $page.Param "paige.page.title.hide" | not }}
{{ $content = cond ($page.Scratch.Get "paige_show_full_pages" | not) ($page.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) $page.Content }} {{ $content = cond ($page.Scratch.Get "paige_list_show_content" | not) ($page.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) $page.Content }}
{{ end }} {{ end }}
{{ with $content }} {{ with $content }}

@ -20,7 +20,7 @@
"integrity" ($page.Param "paige.bootstrap.style.link_integrity") "integrity" ($page.Param "paige.bootstrap.style.link_integrity")
"raw" ($page.Param "paige.bootstrap.style.raw") "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 {{ 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") "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=") "integrity" ($page.Param "paige.math.style.link_integrity" | default "sha256-NJNVfEC6jfEt62wQMafLNT2eI6BaWONXbpkSEVAs3+8=")

@ -22,7 +22,7 @@
<section {{ with $sectionclass }} class="{{ . }}" {{ end }}> <section {{ with $sectionclass }} class="{{ . }}" {{ end }}>
{{ with $title }} {{ with $title }}
<h1 {{ with $titleclass }} class="{{ . }}" {{ end }}>{{ with $titlelink }}<a href="{{ . }}">{{ . }}</a>{{ else }}{{ . }}{{ end }}{{ if $page.Scratch.Get "paige_show_full_pages" }}<a aria-label="Link to this section" class="paige-header-link" href="{{ $titlepage }}">#</a>{{ end }}</h1> <h1 {{ with $titleclass }} class="{{ . }}" {{ end }}>{{ with $titlelink }}<a href="{{ . }}">{{ . }}</a>{{ else }}{{ . }}{{ end }}{{ if $page.Scratch.Get "paige_list_show_content" }}<a aria-label="Link to this section" class="paige-header-link" href="{{ $titlepage }}">#</a>{{ end }}</h1>
{{ end }} {{ end }}
{{ with $description }} {{ with $description }}

@ -3,11 +3,11 @@
{{ $class := "mb-0 text-center" }} {{ $class := "mb-0 text-center" }}
{{ if $page.Pages }} {{ if $page.Pages }}
{{ if $page.Param "paige.show_full_pages" }} {{ if $page.Param "paige.page_list.content.show" }}
{{ $p := $page.Paginate $page.Pages }} {{ $p := $page.Paginate $page.Pages }}
<section> <section>
{{ range $p.Pages }} {{ range $p.Pages }}
{{ $page.Scratch.Set "paige_show_full_pages" true }} {{ $page.Scratch.Set "paige_list_show_content" true }}
{{ partial "paige/article.html" . }} {{ partial "paige/article.html" . }}
{{ end }} {{ end }}
</section> </section>

@ -53,7 +53,7 @@ addEventListener("resize", paigeResize);
"raw" ($page.Param "paige.bootstrap.script.raw") "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") "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 {{ partial "paige/script.html" (dict
"integrity" ($page.Param "paige.math.script.script_integrity") "integrity" ($page.Param "paige.math.script.script_integrity")
"raw" ($page.Param "paige.math.script.raw") "raw" ($page.Param "paige.math.script.raw")

@ -1,6 +1,6 @@
{{ $page := . }} {{ $page := . }}
{{ if and $page.Content ($page.Param "paige.toc") (not (eq ($page.Scratch.Get "paige_show_full_pages") true)) (ne $page.TableOfContents `<nav id="TableOfContents"></nav>`) }} {{ if and $page.Content ($page.Param "paige.toc") (not (eq ($page.Scratch.Get "paige_list_show_content") true)) (ne $page.TableOfContents `<nav id="TableOfContents"></nav>`) }}
<section class="paige-toc"> <section class="paige-toc">
<div class="border mb-3 pe-3 ps-3 pt-3 rounded"> <div class="border mb-3 pe-3 ps-3 pt-3 rounded">
{{ $page.TableOfContents }} {{ $page.TableOfContents }}

Loading…
Cancel
Save