Rename listshowcontent to fullpages

master
Will Faught 2 years ago
parent 136691fb7b
commit ef9b83a2ea

@ -1,13 +1,13 @@
{{ $params := . }} {{ $params := . }}
{{ $fullpages := false }}
{{ $page := . }} {{ $page := . }}
{{ $listshowcontent := false }}
{{ if reflect.IsMap $params }} {{ if reflect.IsMap $params }}
{{ $fullpages = $params.fullpages }}
{{ $page = $params.page }} {{ $page = $params.page }}
{{ $listshowcontent = $params.listshowcontent }}
{{ else }} {{ else }}
{{ $params = dict "listshowcontent" $listshowcontent "page" $page }} {{ $params = dict "fullpages" $fullpages "page" $page }}
{{ end }} {{ end }}
{{ $class := slice "paige-article" }} {{ $class := slice "paige-article" }}

@ -1,18 +1,18 @@
{{ $params := . }} {{ $params := . }}
{{ $fullpages := false }}
{{ $page := . }} {{ $page := . }}
{{ $listshowcontent := false }}
{{ if reflect.IsMap $params }} {{ if reflect.IsMap $params }}
{{ $fullpages = $params.fullpages }}
{{ $page = $params.page }} {{ $page = $params.page }}
{{ $listshowcontent = $params.listshowcontent }}
{{ end }} {{ end }}
{{ $class := $page.Param "paige.content.class" | default "mw-100 paige-content" }} {{ $class := $page.Param "paige.content.class" | default "mw-100 paige-content" }}
{{ $content := "" }} {{ $content := "" }}
{{ if $page.Param "paige.content.hide" | not }} {{ if $page.Param "paige.content.hide" | not }}
{{ $content = cond ($listshowcontent | not) ($page.Content | replaceRE `(<h[1-6] id="([^"]+)".+)(</h[1-6]+>)` (printf `${1}<a aria-label="%v" class="paige-header-link" href="#${2}">#</a>${3}` (i18n "paige_aria_section_link")) | safeHTML) $page.Content }} {{ $content = cond ($fullpages | not) ($page.Content | replaceRE `(<h[1-6] id="([^"]+)".+)(</h[1-6]+>)` (printf `${1}<a aria-label="%v" class="paige-header-link" href="#${2}">#</a>${3}` (i18n "paige_aria_section_link")) | safeHTML) $page.Content }}
{{ end }} {{ end }}
{{ with $content }} {{ with $content }}

@ -1,11 +1,11 @@
{{ $params := . }} {{ $params := . }}
{{ $fullpages := false }}
{{ $page := . }} {{ $page := . }}
{{ $listshowcontent := false }}
{{ if reflect.IsMap $params }} {{ if reflect.IsMap $params }}
{{ $fullpages = $params.fullpages }}
{{ $page = $params.page }} {{ $page = $params.page }}
{{ $listshowcontent = $params.listshowcontent }}
{{ end }} {{ end }}
{{ $authors := partial "paige/authors.html" $page }} {{ $authors := partial "paige/authors.html" $page }}
@ -27,7 +27,7 @@
<section class="paige-metadata w-100"> <section class="paige-metadata w-100">
{{ with $title }} {{ with $title }}
<h1 class="display-5 fw-bold paige-title text-center">{{ with $titlelink }}<a href="{{ . }}">{{ . }}</a>{{ else }}{{ . }}{{ end }}{{ if $listshowcontent }}<a aria-label="{{ i18n `paige_aria_page_link` }}" class="paige-header-link" href="{{ $titlepage }}">#</a>{{ end }}</h1> <h1 class="display-5 fw-bold paige-title text-center">{{ with $titlelink }}<a href="{{ . }}">{{ . }}</a>{{ else }}{{ . }}{{ end }}{{ if $fullpages }}<a aria-label="{{ i18n `paige_aria_page_link` }}" class="paige-header-link" href="{{ $titlepage }}">#</a>{{ end }}</h1>
{{ end }} {{ end }}
{{ with $description }} {{ with $description }}

@ -5,7 +5,7 @@
{{ $p := $page.Paginate $page.Pages }} {{ $p := $page.Paginate $page.Pages }}
<section id="paige-pages"> <section id="paige-pages">
{{ range $p.Pages }} {{ range $p.Pages }}
{{ partial "paige/article.html" (dict "listshowcontent" true "page" .) }} {{ partial "paige/article.html" (dict "fullpages" true "page" .) }}
{{ end }} {{ end }}
</section> </section>
{{ if or $p.HasPrev $p.HasNext }} {{ if or $p.HasPrev $p.HasNext }}

@ -1,14 +1,14 @@
{{ $params := . }} {{ $params := . }}
{{ $fullpages := false }}
{{ $page := . }} {{ $page := . }}
{{ $listshowcontent := false }}
{{ if reflect.IsMap $params }} {{ if reflect.IsMap $params }}
{{ $fullpages = $params.fullpages }}
{{ $page = $params.page }} {{ $page = $params.page }}
{{ $listshowcontent = $params.listshowcontent }}
{{ end }} {{ end }}
{{ if and $page.Content (not $listshowcontent) (ne $page.TableOfContents `<nav id="TableOfContents"></nav>`) }} {{ if and $page.Content (not $fullpages) (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