Remove full pages

This commit is contained in:
Will Faught
2023-03-19 18:18:38 -07:00
parent e24aa20c04
commit d20243aab7
8 changed files with 42 additions and 102 deletions

View File

@@ -1,15 +1,7 @@
{{ $params := . }}
{{ $fullpages := false }}
{{ $page := . }}
{{ if reflect.IsMap $params }}
{{ $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 }}
{{ $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 }}
{{ 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 }}