mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-28 22:19:59 +02:00
Merge commit 'a024bc7d76fcc5e49e8210f9b0896db9ef21861a'
This commit is contained in:
10
docs/layouts/_default/_markup/render-heading.html
Normal file
10
docs/layouts/_default/_markup/render-heading.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<h{{ .Level }} id="{{ .Anchor | safeURL }}">{{ .Text | safeHTML }}
|
||||
{{- if in (slice 2 3 4 6) .Level }}{{" " -}}
|
||||
<a class="anchor" name="{{ .Anchor }}"></a>
|
||||
<a class="inline-flex items-center" href="#{{ .Anchor | safeURL }}" aria-label="Anchor">
|
||||
<svg class="fill-primary hover:fill-primary/70 w-4 h-4">
|
||||
<use href="#icon--anchor"></use>
|
||||
</svg>
|
||||
</a>
|
||||
{{- end -}}
|
||||
</h{{ .Level }}>
|
@@ -185,7 +185,7 @@ either of these shortcodes in conjunction with this render hook.
|
||||
{{- end }}
|
||||
|
||||
{{- /* Render anchor element. */ -}}
|
||||
<a
|
||||
<a aria-label="{{ .PlainText }}"
|
||||
{{- with .Title }} title="{{ . }}" {{- end }}
|
||||
{{- range $k, $v := $attrs }}
|
||||
{{- if $v }}
|
||||
@@ -271,7 +271,7 @@ either of these shortcodes in conjunction with this render hook.
|
||||
{{- $text := .text | transform.Plainify | strings.ToLower }}
|
||||
|
||||
{{- /* Initialize. */}}
|
||||
{{- $glossaryPath := "/getting-started/glossary" }}
|
||||
{{- $glossaryPath := "/quick-reference/glossary" }}
|
||||
{{- $termGiven := $text }}
|
||||
{{- $termActual := "" }}
|
||||
{{- $termSingular := inflect.Singularize $termGiven }}
|
||||
@@ -282,7 +282,7 @@ either of these shortcodes in conjunction with this render hook.
|
||||
{{- errorf "The %q render hook was unable to find %s: see %s" $renderHookName $glossaryPath $contentPath }}
|
||||
{{- end }}
|
||||
|
||||
{{- /* Theres a better way to handle this, but it works for now. */}}
|
||||
{{- /* There's a better way to handle this, but it works for now. */}}
|
||||
{{- $cheating := dict
|
||||
"chaining" "chain"
|
||||
"localize" "localization"
|
||||
|
Reference in New Issue
Block a user