2023-06-22 08:52:32 +00:00
|
|
|
{{- $showAnchor := (and (default true .Page.Params.geekblogAnchor) (default true .Page.Site.Params.geekblogAnchor)) -}}
|
2021-02-21 12:24:55 +00:00
|
|
|
|
2021-12-30 14:55:55 +00:00
|
|
|
|
|
|
|
<!-- prettier-ignore-start -->
|
2021-05-23 12:57:55 +00:00
|
|
|
{{- if $showAnchor -}}
|
2022-07-11 12:50:45 +00:00
|
|
|
<div class="gblog-post__anchorwrap">
|
2023-04-21 21:05:46 +00:00
|
|
|
<h{{ .Level }} id="{{ .Anchor | safeURL }}" {{- with .Attributes.class }}
|
|
|
|
class="{{ . }}"
|
|
|
|
{{- end }}
|
|
|
|
>
|
2021-02-21 12:24:55 +00:00
|
|
|
{{ .Text | safeHTML }}
|
2022-07-11 12:50:45 +00:00
|
|
|
<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>
|
|
|
|
</a>
|
2021-02-21 12:24:55 +00:00
|
|
|
</h{{ .Level }}>
|
|
|
|
</div>
|
2021-05-23 12:57:55 +00:00
|
|
|
{{- else -}}
|
2021-02-21 12:24:55 +00:00
|
|
|
<div class="gblog-post__anchorwrap">
|
2023-04-21 21:05:46 +00:00
|
|
|
<h{{ .Level }} id="{{ .Anchor | safeURL }}" {{- with .Attributes.class }}
|
|
|
|
class="{{ . }}"
|
|
|
|
{{- end }}
|
|
|
|
>
|
2021-02-21 12:24:55 +00:00
|
|
|
{{ .Text | safeHTML }}
|
|
|
|
</h{{ .Level }}>
|
|
|
|
</div>
|
2021-05-23 12:57:55 +00:00
|
|
|
{{- end -}}
|
2021-12-30 14:55:55 +00:00
|
|
|
<!-- prettier-ignore-end -->
|