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

This commit is contained in:
Will Faught
2023-02-04 21:15:40 -08:00
parent 91865e3ade
commit 226d4129f2
8 changed files with 12 additions and 9 deletions

View File

@@ -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 `(<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 }}
{{ with $content }}

View File

@@ -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=")

View File

@@ -22,7 +22,7 @@
<section {{ with $sectionclass }} class="{{ . }}" {{ end }}>
{{ 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 }}
{{ with $description }}

View File

@@ -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 }}
<section>
{{ range $p.Pages }}
{{ $page.Scratch.Set "paige_show_full_pages" true }}
{{ $page.Scratch.Set "paige_list_show_content" true }}
{{ partial "paige/article.html" . }}
{{ end }}
</section>

View File

@@ -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")

View File

@@ -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 `<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">
<div class="border mb-3 pe-3 ps-3 pt-3 rounded">
{{ $page.TableOfContents }}