1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-10 00:12:09 +00:00

Only render anchor links in post pages

This commit is contained in:
Rohan Kumar 2022-04-25 17:35:14 -07:00
parent 4d5c725147
commit ec5d613ffc
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479

View file

@ -15,7 +15,7 @@
Yeah I know, the situation isn't optimal.
-->
<h{{ .Level }} id="{{ .Anchor | safeURL }}">{{ .Text | safeHTML }}
{{ if gt .Level 1 -}}
{{ if and (gt .Level 1) (eq .Page.Section "posts") -}}
<a href="#{{ .Anchor | safeURL }}" aria-hidden="true" tabindex="-1">
{{- $octothorpes := sub .Level 1 -}}
{{- range $i, $sequence := (seq $octothorpes) -}}