mirror of
https://github.com/thegeeklab/hugo-geekdoc.git
synced 2024-11-25 14:20:42 +00:00
feat: add support for custom heading css class (#608)
This commit is contained in:
parent
d6f09016a3
commit
4ea6acc9d4
@ -4,7 +4,10 @@
|
|||||||
<!-- prettier-ignore-start -->
|
<!-- prettier-ignore-start -->
|
||||||
{{- if $showAnchor -}}
|
{{- if $showAnchor -}}
|
||||||
<div class="gdoc-page__anchorwrap">
|
<div class="gdoc-page__anchorwrap">
|
||||||
<h{{ .Level }} id="{{ .Anchor | safeURL }}">
|
<h{{ .Level }} id="{{ .Anchor | safeURL }}" {{- with .Attributes.class }}
|
||||||
|
class="{{ . }}"
|
||||||
|
{{- end }}
|
||||||
|
>
|
||||||
{{ .Text | safeHTML }}
|
{{ .Text | safeHTML }}
|
||||||
<a data-clipboard-text="{{ .Page.Permalink }}#{{ .Anchor | safeURL }}" class="gdoc-page__anchor clip flex align-center" title="{{ i18n "title_anchor_prefix" }} {{ .Text | safeHTML }}" aria-label="{{ i18n "title_anchor_prefix" }} {{ .Text | safeHTML }}" href="#{{ .Anchor | safeURL }}">
|
<a data-clipboard-text="{{ .Page.Permalink }}#{{ .Anchor | safeURL }}" class="gdoc-page__anchor clip flex align-center" title="{{ i18n "title_anchor_prefix" }} {{ .Text | safeHTML }}" aria-label="{{ i18n "title_anchor_prefix" }} {{ .Text | safeHTML }}" href="#{{ .Anchor | safeURL }}">
|
||||||
<svg class="gdoc-icon gdoc_link"><use xlink:href="#gdoc_link"></use></svg>
|
<svg class="gdoc-icon gdoc_link"><use xlink:href="#gdoc_link"></use></svg>
|
||||||
@ -13,7 +16,10 @@
|
|||||||
</div>
|
</div>
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
<div class="gdoc-page__anchorwrap">
|
<div class="gdoc-page__anchorwrap">
|
||||||
<h{{ .Level }} id="{{ .Anchor | safeURL }}">
|
<h{{ .Level }} id="{{ .Anchor | safeURL }}" {{- with .Attributes.class }}
|
||||||
|
class="{{ . }}"
|
||||||
|
{{- end }}
|
||||||
|
>
|
||||||
{{ .Text | safeHTML }}
|
{{ .Text | safeHTML }}
|
||||||
</h{{ .Level }}>
|
</h{{ .Level }}>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user