mirror of
https://github.com/thegeeklab/hugo-geekblog.git
synced 2024-11-22 05:00:39 +00:00
feat: add support for custom heading css class (#381)
This commit is contained in:
parent
0b2444e0cc
commit
eb86a76010
@ -4,7 +4,10 @@
|
|||||||
<!-- prettier-ignore-start -->
|
<!-- prettier-ignore-start -->
|
||||||
{{- if $showAnchor -}}
|
{{- if $showAnchor -}}
|
||||||
<div class="gblog-post__anchorwrap">
|
<div class="gblog-post__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="gblog-post__anchor clip flex align-center" aria-label="Anchor {{ .Text | safeHTML }}" href="#{{ .Anchor | safeURL }}">
|
<a data-clipboard-text="{{ .Page.Permalink }}#{{ .Anchor | safeURL }}" class="gblog-post__anchor clip flex align-center" aria-label="Anchor {{ .Text | safeHTML }}" href="#{{ .Anchor | safeURL }}">
|
||||||
<svg class="gblog-icon gblog_link"><use xlink:href="#gblog_link"></use></svg>
|
<svg class="gblog-icon gblog_link"><use xlink:href="#gblog_link"></use></svg>
|
||||||
@ -13,7 +16,10 @@
|
|||||||
</div>
|
</div>
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
<div class="gblog-post__anchorwrap">
|
<div class="gblog-post__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