fix: remove redundant markup template

This commit is contained in:
Mark Dumay
2025-09-17 05:29:08 +02:00
parent 816455676a
commit 856c264544
2 changed files with 2 additions and 20 deletions

View File

@@ -1,18 +0,0 @@
{{ $class := .Attributes.class }}
{{ $text := chomp .Text }}
{{ if site.Params.main.titleCase }}{{ $text = title $text }}{{ end }}
{{ if eq page.RelPermalink "/en/privacy/" }}
{{ warnf "title: %s" (.Text | safeHTML) }}
{{ end }}
{{ if and site.Params.navigation.anchor $text }}
<h{{ .Level }} id="{{ .Anchor | safeURL }}" class="heading {{ with $class }}{{.}}{{end}}">
{{- $text | safeHTML -}}
<a href="#{{ .Anchor | safeURL }}" aria-labelledby="{{ .Anchor | safeURL }}">
{{- partial "assets/icon.html" (dict "icon" "fas link anchor") }}
</a>
</h{{ .Level }}>
{{ else }}
<h{{ .Level }} id="{{ .Anchor | safeURL }}" {{ with $class }} class="{{.}}"{{end }}>{{ $text | safeHTML }}</h{{ .Level }}>
{{ end }}

View File

@@ -3,12 +3,12 @@
{{ if site.Params.main.titleCase }}{{ $text = (title ($text | htmlUnescape)) | htmlEscape }}{{ end }} {{ if site.Params.main.titleCase }}{{ $text = (title ($text | htmlUnescape)) | htmlEscape }}{{ end }}
{{ if and site.Params.navigation.anchor $text }} {{ if and site.Params.navigation.anchor $text }}
<h{{ .Level }} id="{{ .Anchor | safeURL }}" class="heading {{ with $class }}{{.}}{{end}}"> <h{{ .Level }} id="{{ .Anchor | safeURL }}" class="heading {{ with $class }}{{ . }}{{ end }}">
{{- $text | safeHTML -}} {{- $text | safeHTML -}}
<a href="#{{ .Anchor | safeURL }}" aria-labelledby="{{ .Anchor | safeURL }}"> <a href="#{{ .Anchor | safeURL }}" aria-labelledby="{{ .Anchor | safeURL }}">
{{- partial "assets/icon.html" (dict "icon" "fas link anchor") }} {{- partial "assets/icon.html" (dict "icon" "fas link anchor") }}
</a> </a>
</h{{ .Level }}> </h{{ .Level }}>
{{ else }} {{ else }}
<h{{ .Level }} id="{{ .Anchor | safeURL }}" {{ with $class }} class="{{.}}"{{end }}>{{ $text | safeHTML }}</h{{ .Level }}> <h{{ .Level }} id="{{ .Anchor | safeURL }}" {{ with $class }} class="{{ . }}"{{ end }}>{{ $text | safeHTML }}</h{{ .Level }}>
{{ end }} {{ end }}