Change all header text to be linked
This commit is contained in:
3
layouts/_default/_markup/render-heading.html
Normal file
3
layouts/_default/_markup/render-heading.html
Normal file
@@ -0,0 +1,3 @@
|
||||
<h{{ .Level }} id="{{ .Anchor }}" {{ range $k, $v := .Attributes }} {{ printf `%s="%s"` $k $v | safeHTMLAttr }} {{ end }}>
|
||||
<a aria-label="{{ i18n "paige_link_to_this_section" }}" class="text-body text-decoration-none" href="#{{ .Anchor }}">{{ .Text }}</a>
|
||||
</h{{ .Level }}>
|
@@ -1,7 +1,7 @@
|
||||
{{ $page := . }}
|
||||
|
||||
{{ $class := slice }}
|
||||
{{ $content := $page.Content | replaceRE `(<h[1-6] id="([^"]+)".+)(</h[1-6]+>)` (printf `${1}<a aria-label="%s" class="paige-header-link" href="#${2}"></a>${3}` (i18n "paige_link_to_this_section")) }}
|
||||
{{ $content := $page.Content }}
|
||||
{{ $draft := $page.Draft }}
|
||||
{{ $expired := and $page.ExpiryDate (lt $page.ExpiryDate now) }}
|
||||
{{ $future := and $page.PublishDate (gt $page.PublishDate now) }}
|
||||
|
Reference in New Issue
Block a user