Skip to content

Commit

Permalink
Tweak heading anchors
Browse files Browse the repository at this point in the history
  • Loading branch information
rmoff committed Nov 1, 2023
1 parent 9ccd3d4 commit 1c005ec
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion themes/story/layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{{ define "main" }}
<article class="center bg-white br-3 pv1 ph4 lh-copy f5 nested-links mw8">
{{ .Content | replaceRE "(<h[2-9] id=\"([^\"]+)\".+)(</h[2-9]+>)" "${1}&nbsp;<a class=\"headline-hash\" href=\"#${2}\">#</a> ${3}" | safeHTML }}
{{ .Content | replaceRE "(<h[2-9] id=\"([^\"]+)\".+)(</h[2-9]+>)" "${1}&nbsp;<a class=\"headline-hash\" href=\"#${2}\">🔗</a> ${3}" | safeHTML }}
</article>
{{ end }}

Expand Down
3 changes: 2 additions & 1 deletion themes/story/static/css/story.css
Original file line number Diff line number Diff line change
Expand Up @@ -417,4 +417,5 @@ img[src~="3dbook"] {
.hljs-link {
text-decoration: underline;
}
a.headline-hash {opacity: 40%; text-decoration: none;}
a.headline-hash {opacity: 20%; text-decoration: none; font-size:80%; transition: opacity 0.5s;}
a.headline-hash:hover {opacity: 100%; font-size:100%;}

0 comments on commit 1c005ec

Please sign in to comment.