Add config to hide page data
parent
a2b36a4208
commit
388b7d757a
@ -1,17 +1,8 @@
|
||||
{{ if .Content }}
|
||||
{{ $class := $.Param "paige.page.content_class" }}
|
||||
{{ $class := .Param "paige.page.content_class" }}
|
||||
{{ $content := cond (.Scratch.Get "paige_show_full_pages" | not | not) .Content (.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) }}
|
||||
|
||||
<section class="paige-content">
|
||||
{{ with $class }}
|
||||
<div class="{{ . }}">
|
||||
{{ end }}
|
||||
{{ if .Scratch.Get "paige_show_full_pages" }}
|
||||
{{ .Content }}
|
||||
{{ else }}
|
||||
{{ .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 }}
|
||||
{{ end }}
|
||||
{{ if $class }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ with $content }}
|
||||
<section class="paige-content {{ with $class }} {{ . }} {{ end }}">
|
||||
{{ . }}
|
||||
</section>
|
||||
{{ end }}
|
||||
|
@ -1,5 +1,6 @@
|
||||
{{ with .Description }}
|
||||
{{ $class := $.Param "paige.page.description_class" | default "lead text-center" }}
|
||||
{{ $class := .Param "paige.page.description_class" | default "lead text-center" }}
|
||||
{{ $description := cond (.Param "paige.page.hide_description" | not | not) "" (.Description | markdownify) }}
|
||||
|
||||
<p class="{{ $class }}">{{ . | markdownify }}</p>
|
||||
{{ with $description }}
|
||||
<p class="{{ $class }}">{{ . }}</p>
|
||||
{{ end }}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{{ if .Title }}
|
||||
{{ $class := .Param "paige.page.title_class" | default "display-5 fw-bold text-center" }}
|
||||
{{ $title := .Title | markdownify }}
|
||||
{{ $title := cond (.Param "paige.page.hide_title" | not | not) "" (.Title | markdownify) }}
|
||||
|
||||
{{ if $title }}
|
||||
<h1 class="{{ $class }}">{{ if .Params.link }}<a href="{{ .Params.link }}">{{ $title }}</a>{{ else }}{{ $title }}{{ end }}{{ if .Scratch.Get "paige_show_full_pages" }}<a aria-label="Link to this section" class="paige-header-link" href="{{ .RelPermalink }}">#</a>{{ end }}</h1>
|
||||
{{ end }}
|
||||
|
Loading…
Reference in New Issue