Add content-class page param

master
Will Faught 2 years ago
parent d3a89c7892
commit 1ee1c97b4a

@ -283,6 +283,7 @@ authors: [
link: "https://youtu.be/dQw4w9WgXcQ" # The reference for an anchor around the title link: "https://youtu.be/dQw4w9WgXcQ" # The reference for an anchor around the title
paige: paige:
about_class: "h6 text-end" # Page about class about_class: "h6 text-end" # Page about class
content_class: "fst-italic" # Page content class
description_class: "h5 text-start" # Page description class description_class: "h5 text-start" # Page description class
math: true # Enable math typesetting with KaTeX math: true # Enable math typesetting with KaTeX
title_class: "display-1 fw-medium text-start" # Page title class title_class: "display-1 fw-medium text-start" # Page title class

@ -1,9 +1,17 @@
{{ if .Content }} {{ if .Content }}
{{ $class := $.Params.paige.content_class }}
<section class="paige-content"> <section class="paige-content">
{{ with $class }}
<div class="{{ . }}">
{{ end }}
{{ if .Scratch.Get "paige_show_full_pages" }} {{ if .Scratch.Get "paige_show_full_pages" }}
{{ .Content }} {{ .Content }}
{{ else }} {{ 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 }} {{ .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 }} {{ end }}
{{ if $class }}
</div>
{{ end }}
</section> </section>
{{ end }} {{ end }}

Loading…
Cancel
Save