Skip to content

Commit

Permalink
Merge pull request tomfran#49 from runofthemillgeek/feat/heading-anchors
Browse files Browse the repository at this point in the history
Add article heading anchors
  • Loading branch information
tomfran authored Nov 18, 2024
2 parents afd36b2 + 62972cf commit 5ee19e9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
13 changes: 13 additions & 0 deletions assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions layouts/_default/_markup/render-heading.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<h{{ .Level }} class="heading" id="{{ .Anchor }}">
{{ .Text }}
<a href="#{{ .Anchor }}">#</a>
</h{{ .Level }}>

0 comments on commit 5ee19e9

Please sign in to comment.