Add anchors to headings

Signed-off-by: KenHV <yo@kenharris.xyz>
This commit is contained in:
KenHV 2021-11-26 21:27:50 +05:30
parent c37f1b6591
commit d32455142d
3 changed files with 21 additions and 1 deletions

View File

@ -272,3 +272,19 @@ blockquote.twitter-tweet {
line-height: inherit;
border-radius: 8px;
}
.h-anchor {
visibility: hidden;
opacity: 0;
transition: visibility 0s linear 0.1s, opacity 0.1s linear;
margin-left: 1px;
}
h1:hover a,
h2:hover a,
h3:hover a,
h4:hover a {
visibility: visible;
opacity: 1;
transition-delay: 0s;
}

View File

@ -0,0 +1,4 @@
<h{{ .Level }} id="{{ .Anchor | safeURL }}">
{{ .Text | safeHTML }}
<a href="#{{ .Anchor | safeURL }}" class="h-anchor" aria-hidden="true">#</a>
</h{{ .Level }}>

File diff suppressed because one or more lines are too long