Merge pull request #273 from KenHV/master

Add anchors to headings
This commit is contained in:
Radek Kozieł 2022-01-24 17:24:54 +01:00 committed by GitHub
commit 303616c5a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 1 deletions

View File

@ -272,3 +272,23 @@ 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;
}
.framed .h-anchor {
visibility: hidden;
}

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