Skip to content

Commit

Permalink
include anchor links while rendering headings
Browse files Browse the repository at this point in the history
Signed-off-by: Weru <fromweru@gmail.com>
  • Loading branch information
onweru committed Jul 11, 2024
1 parent 1adb685 commit 1ea10f3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions layouts/_default/_markup/render-heading.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<h{{ .Level }} id="{{ .Anchor }}">
{{ .Text | safeHTML }}
<a href="#{{ .Anchor }}">
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"></path><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg>
</a>
</h{{ .Level }}>

0 comments on commit 1ea10f3

Please sign in to comment.