Merge pull request #49 from runofthemillgeek/feat/heading-anchors

Add article heading anchors
This commit is contained in:
Francesco Tomaselli 2024-11-18 22:17:01 +01:00 committed by GitHub
commit 5ee19e964c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 17 additions and 0 deletions

View file

@ -37,6 +37,19 @@ h6 {
margin-bottom: var(--hx-margin-bottom);
}
.heading {
a {
text-decoration: none;
color: var(--content-secondary);
visibility: hidden;
font-size: 0.95em;
}
&:hover a {
visibility: visible;
}
}
p {
margin-top: var(--p-margin-top);
margin-bottom: var(--p-margin-bottom);

View file

@ -0,0 +1,4 @@
<h{{ .Level }} class="heading" id="{{ .Anchor }}">
{{ .Text }}
<a href="#{{ .Anchor }}">#</a>
</h{{ .Level }}>