add an anchor tag for heading tags

This commit is contained in:
kurets 2023-03-31 21:04:17 +03:00
parent 74d8389340
commit 5204b6f0ce
2 changed files with 15 additions and 0 deletions

View file

@ -0,0 +1,7 @@
<h{{ .Level }} id="{{ .Anchor | safeURL }}">{{ .Text | safeHTML }}
{{- if and (ge .Level 1) (le .Level 6) }}{{" " -}}
<a class="anchor" href="#{{ .Anchor | safeURL }}">
<span class="spanForHeader">#</span>
</a>
{{- end -}}
</h{{ .Level }}>

View file

@ -116,4 +116,12 @@ pre {
overflow-wrap: break-word;
max-width: 800px;
margin: auto;
}
.spanForHeader{
color: rgba(0, 255, 255, 0);
}
.spanForHeader:hover{
color: cyan;
}