Files
paige-hugo/layouts/partials/paige/content.html
2023-01-28 18:24:59 -08:00

9 lines
432 B
HTML

{{ $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) }}
{{ with $content }}
<section class="paige-content {{ with $class }} {{ . }} {{ end }}">
{{ . }}
</section>
{{ end }}