Remove full pages

master
Will Faught 2 years ago
parent e24aa20c04
commit d20243aab7

@ -283,8 +283,6 @@ paige:
web_master: "" web_master: ""
search: search:
hide_page: false hide_page: false
section_pages:
full_pages: false # Display full pages in the list of pages
style: "" # CSS included at the end of the stylesheet, before style-last.css style: "" # CSS included at the end of the stylesheet, before style-last.css
``` ```

@ -1,20 +1,9 @@
{{ $params := . }}
{{ $fullpages := false }}
{{ $page := . }} {{ $page := . }}
{{ if reflect.IsMap $params }} {{ $class := slice }}
{{ $fullpages = $params.fullpages }}
{{ $page = $params.page }}
{{ else }}
{{ $params = dict "fullpages" $fullpages "page" $page }}
{{ end }}
{{ $class := cond $fullpages (slice "paige-article") slice }}
{{ $draft := $page.Draft }} {{ $draft := $page.Draft }}
{{ $expired := and $page.ExpiryDate (lt $page.ExpiryDate now) }} {{ $expired := and $page.ExpiryDate (lt $page.ExpiryDate now) }}
{{ $future := and $page.PublishDate (gt $page.PublishDate now) }} {{ $future := and $page.PublishDate (gt $page.PublishDate now) }}
{{ $id := not $fullpages }}
{{ $modified := and $page.PublishDate $page.Lastmod (lt $page.PublishDate $page.Lastmod) }} {{ $modified := and $page.PublishDate $page.Lastmod (lt $page.PublishDate $page.Lastmod) }}
{{ if $draft }} {{ if $draft }}
@ -53,11 +42,11 @@
{{ $class = delimit ($class | uniq) " " }} {{ $class = delimit ($class | uniq) " " }}
<article {{ with $class }} class="{{ . }}" {{ end }} {{ if $id }} id="paige-article" {{ end }}> <article {{ with $class }} class="{{ . }}" {{ end }} id="paige-article">
<div class="align-items-center d-flex flex-column mb-0"> <div class="align-items-center d-flex flex-column mb-0">
{{ partial "paige/metadata.html" $params }} {{ partial "paige/metadata.html" $page }}
{{ partial "paige/alert.html" $page }} {{ partial "paige/alert.html" $page }}
{{ partial "paige/toc.html" $params }} {{ partial "paige/toc.html" $page }}
{{ partial "paige/content.html" $params }} {{ partial "paige/content.html" $page }}
</div> </div>
</article> </article>

@ -1,15 +1,7 @@
{{ $params := . }}
{{ $fullpages := false }}
{{ $page := . }} {{ $page := . }}
{{ if reflect.IsMap $params }} {{ $content := $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 }}
{{ $fullpages = $params.fullpages }}
{{ $page = $params.page }}
{{ end }}
{{ $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 }}
{{ with $content }} {{ with $content }}
<div class="mw-100 overflow-x-auto {{ if $fullpages }} paige-content {{ end }}" {{ if not $fullpages }} id="paige-content" {{ end }}>{{ . }}</div> <div class="mw-100 overflow-x-auto" id="paige-content">{{ . }}</div>
{{ end }} {{ end }}

@ -16,7 +16,7 @@
{{ partial "paige/link.html" (dict "href" "_paige/bootstrap/paige.scss" "page" $page "sass" true) }} {{ partial "paige/link.html" (dict "href" "_paige/bootstrap/paige.scss" "page" $page "sass" true) }}
{{ partial "paige/link.html" (dict "href" "_paige/bootstrap-icons/bootstrap-icons.css") }} {{ partial "paige/link.html" (dict "href" "_paige/bootstrap-icons/bootstrap-icons.css") }}
{{ if or ($page.Param "paige.math") (and ($page.Param "paige.section_pages.full_pages") (where $page.Pages "Params.paige.math" "eq" true)) }} {{ if $page.Param "paige.math" }}
{{ partial "paige/link.html" (dict "href" "_paige/katex/katex.min.css") }} {{ partial "paige/link.html" (dict "href" "_paige/katex/katex.min.css") }}
{{ end }} {{ end }}

@ -1,21 +1,11 @@
{{ $params := . }}
{{ $fullpages := false }}
{{ $page := . }} {{ $page := . }}
{{ if reflect.IsMap $params }}
{{ $fullpages = $params.fullpages }}
{{ $page = $params.page }}
{{ end }}
{{ $authors := partial "paige/authors.html" $page }} {{ $authors := partial "paige/authors.html" $page }}
{{ $categories := $page.Params.categories | default slice | uniq }} {{ $categories := $page.Params.categories | default slice | uniq }}
{{ $class := $fullpages }}
{{ $commiturl := "" }} {{ $commiturl := "" }}
{{ $date := cond (eq ($page.Param "paige.date.source" | default "published") "published") $page.PublishDate $page.Lastmod }} {{ $date := cond (eq ($page.Param "paige.date.source" | default "published") "published") $page.PublishDate $page.Lastmod }}
{{ $dateformat := $page.Param "paige.date.format" | default ":date_long" }} {{ $dateformat := $page.Param "paige.date.format" | default ":date_long" }}
{{ $description := $page.Description | markdownify }} {{ $description := $page.Description | markdownify }}
{{ $id := not $fullpages }}
{{ $readingtime := $page.ReadingTime }} {{ $readingtime := $page.ReadingTime }}
{{ $series := $page.Params.series }} {{ $series := $page.Params.series }}
{{ $tags := $page.Params.tags | default slice | uniq }} {{ $tags := $page.Params.tags | default slice | uniq }}
@ -27,17 +17,17 @@
{{ $commiturl = print ($page.Param "paige.git.commit_url_prefix") $page.GitInfo.Hash }} {{ $commiturl = print ($page.Param "paige.git.commit_url_prefix") $page.GitInfo.Hash }}
{{ end }} {{ end }}
<div class="{{ if $class }} paige-metadata {{ end }} w-100" {{ if $id }} id="paige-metadata" {{ end }}> <div class="w-100" id="paige-metadata">
{{ with $title }} {{ with $title }}
<h1 class="display-5 fw-bold {{ if $class }} paige-title {{ end }} text-center" {{ if $id }} id="paige-title" {{ end }}>{{ 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> <h1 class="display-5 fw-bold text-center" id="paige-title">{{ with $titlelink }}<a href="{{ . }}">{{ . }}</a>{{ else }}{{ . }}{{ end }}</h1>
{{ end }} {{ end }}
{{ with $description }} {{ with $description }}
<p class="lead {{ if $class }} paige-description {{ end }} text-center" {{ if $id }} id="paige-description" {{ end }}>{{ . }}</p> <p class="lead text-center" id="paige-description">{{ . }}</p>
{{ end }} {{ end }}
{{ if or $categories $tags }} {{ if or $categories $tags }}
<p class="{{ if $class }} paige-keywords {{ end }} text-center" {{ if $id }} id="paige-keywords" {{ end }}> <p class="text-center" id="paige-keywords">
{{ $terms := slice }} {{ $terms := slice }}
{{ range $categories }} {{ range $categories }}
@ -63,7 +53,7 @@
{{ if or $authors $date $readingtime $series }} {{ if or $authors $date $readingtime $series }}
<div class="mb-3"> <div class="mb-3">
{{ with $series }} {{ with $series }}
<p class="mb-0 {{ if $class }} paige-series {{ end }} text-center text-secondary" {{ if $id }} id="paige-series" {{ end }}> <p class="mb-0 text-center text-secondary" id="paige-series">
{{ range $i, $name := . -}} {{ range $i, $name := . -}}
{{- if gt $i 0 }}, {{ end -}} {{- if gt $i 0 }}, {{ end -}}
@ -77,7 +67,7 @@
{{ end }} {{ end }}
{{ with $authors }} {{ with $authors }}
<p class="mb-0 {{ if $class }} paige-authors {{ end }} text-center text-secondary" {{ if $id }} id="paige-authors" {{ end }}> <p class="mb-0 text-center text-secondary" id="paige-authors">
{{ range $i, $author := . -}} {{ range $i, $author := . -}}
{{- if gt $i 0 }}, {{ end -}} {{- if gt $i 0 }}, {{ end -}}
@ -95,7 +85,7 @@
{{ end }} {{ end }}
{{ with $date }} {{ with $date }}
<p class="mb-0 {{ if $class }} paige-date {{ end }} text-center text-secondary" {{ if $id }} id="paige-date" {{ end }}> <p class="mb-0 text-center text-secondary" id="paige-date">
{{ with $commiturl }} {{ with $commiturl }}
<a class="link-secondary" href="{{ . }}"> <a class="link-secondary" href="{{ . }}">
{{ end }} {{ end }}
@ -109,7 +99,7 @@
{{ end }} {{ end }}
{{ with $readingtime }} {{ with $readingtime }}
<p class="mb-0 {{ if $class }} paige-reading-time {{ end }} text-center text-secondary" {{ if $id }} id="paige-reading-time" {{ end }}>{{ . }} {{ i18n "paige_minutes" . }}</p> <p class="mb-0 text-center text-secondary" id="paige-reading-time">{{ . }} {{ i18n "paige_minutes" . }}</p>
{{ end }} {{ end }}
</div> </div>
{{ end }} {{ end }}

@ -29,56 +29,35 @@
{{ end }} {{ end }}
{{ with $pages }} {{ with $pages }}
{{ if $page.Param "paige.section_pages.full_pages" }} <div id="paige-pages">
{{ $pager := $page.Paginate . }} {{ if or $collections $sections }}
<div id="paige-pages"> <h2 class="h4 text-center" id="paige-pages-header">{{ i18n "paige_pages" }}</h2>
{{ if or $collections $sections }}
<h2 class="h4 text-center" id="paige-pages-header">{{ i18n "paige_pages" }}</h2>
{{ end }}
{{ range $pager.Pages }}
{{ partial "paige/article.html" (dict "fullpages" true "page" .) }}
{{ end }}
</div>
{{ if or $pager.HasPrev $pager.HasNext }}
<div id="paige-pagination">
<div class="d-flex justify-content-center">
{{ partial "paige/pagination.html" $page }}
</div>
</div>
{{ end }} {{ end }}
{{ else }}
<div id="paige-pages">
{{ if or $collections $sections }}
<h2 class="h4 text-center" id="paige-pages-header">{{ i18n "paige_pages" }}</h2>
{{ end }}
{{ $pinned := where . "Params.paige.pin" true }} {{ $pinned := where . "Params.paige.pin" true }}
{{ range $pinned.ByPublishDate.Reverse }} {{ range $pinned.ByPublishDate.Reverse }}
{{ partial "paige/page.html" . }} {{ partial "paige/page.html" . }}
{{ end }} {{ end }}
{{ $unpinned := complement $pinned . }} {{ $unpinned := complement $pinned . }}
{{ $pagegroups := $unpinned.ByPublishDate.Reverse.GroupByPublishDate "January 2006" }} {{ $pagegroups := $unpinned.ByPublishDate.Reverse.GroupByPublishDate "January 2006" }}
{{ $pager := $page.Paginate $pagegroups }} {{ $pager := $page.Paginate $pagegroups }}
{{ range $pager.PageGroups }} {{ range $pager.PageGroups }}
<h3 class="h5 paige-date-header text-center">{{ .Key }}</h3> <h3 class="h5 paige-date-header text-center">{{ .Key }}</h3>
{{ range .Pages }} {{ range .Pages }}
{{ partial "paige/page.html" . }} {{ partial "paige/page.html" . }}
{{ end }}
{{ end }} {{ end }}
</div> {{ end }}
</div>
{{ if or $pager.HasPrev $pager.HasNext }} {{ if or $pager.HasPrev $pager.HasNext }}
<div id="paige-pagination"> <div id="paige-pagination">
<div class="d-flex justify-content-center"> <div class="d-flex justify-content-center">
{{ partial "paige/pagination.html" $page }} {{ partial "paige/pagination.html" $page }}
</div>
</div> </div>
{{ end }} </div>
{{ end }} {{ end }}
{{ end }} {{ end }}

@ -33,7 +33,7 @@ addEventListener("resize", paigeResize);
</script> </script>
{{ partial "paige/script.html" (dict "src" "_paige/bootstrap/bootstrap.bundle.js") }} {{ partial "paige/script.html" (dict "src" "_paige/bootstrap/bootstrap.bundle.js") }}
{{ if or ($page.Param "paige.math") (and ($page.Param "paige.section_pages.full_pages") (where $page.Pages "Params.paige.math" "eq" true)) }} {{ if $page.Param "paige.math" }}
{{ partial "paige/script.html" (dict "src" "_paige/katex/katex.min.js") }} {{ partial "paige/script.html" (dict "src" "_paige/katex/katex.min.js") }}
{{ partial "paige/script.html" (dict "onload" "renderMathInElement(document.body);" "src" "_paige/katex/auto-render.min.js") }} {{ partial "paige/script.html" (dict "onload" "renderMathInElement(document.body);" "src" "_paige/katex/auto-render.min.js") }}
{{ end }} {{ end }}

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