Files
paige-hugo/layouts/partials/paige/content.html
2023-01-28 16:02:38 -08:00

18 lines
573 B
HTML

{{ if .Content }}
{{ $class := $.Param "paige.page.content_class" }}
<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 }}
</section>
{{ end }}