mirror of
https://github.com/thomasjsn/hugo-theme-hello-friend.git
synced 2024-11-24 00:35:07 +01:00
Add anchors to headings
Signed-off-by: KenHV <yo@kenharris.xyz>
This commit is contained in:
parent
c37f1b6591
commit
d32455142d
@ -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;
|
||||
}
|
||||
|
4
layouts/_default/_markup/render-heading.html
Normal file
4
layouts/_default/_markup/render-heading.html
Normal 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
Loading…
Reference in New Issue
Block a user