mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-30 22:52:24 +01:00
render-heading.html: use variables
This commit is contained in:
parent
87be2b9d24
commit
688d7e352a
@ -1,5 +1,7 @@
|
||||
<h{{ .Level }} id="{{ .Anchor | safeURL }}">{{ .Text | safeHTML }}
|
||||
{{- $id := .Anchor | safeURL -}}
|
||||
{{- $text := .Text | safeHTML -}}
|
||||
<h{{ .Level }} id="{{ $id }}">{{ $text }}
|
||||
{{- if and (ge .Level .Page.Site.Params.anchors.min) (le .Level .Page.Site.Params.anchors.max) }}{{" " -}}
|
||||
<a class="anchor-link" href="#{{ .Anchor | safeURL }}" aria-label="Link to this section: {{ .Text | safeHTML }}"></a>
|
||||
<a class="anchor-link" href="#{{ $id }}" aria-label="Link to this section: {{ $text }}"></a>
|
||||
{{- end -}}
|
||||
</h{{ .Level }}>
|
||||
|
Loading…
x
Reference in New Issue
Block a user