Skip to content

Commit

Permalink
Add titles anchor links
Browse files Browse the repository at this point in the history
  • Loading branch information
clementbiron committed Jul 8, 2024
1 parent 21c4cc4 commit 8e3eeb5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
15 changes: 15 additions & 0 deletions themes/opentermsarchive/assets/css/elements/titles.css
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,18 @@ h6,
color: var(--colorBlack800);
line-height: 1.25;
}

.title-anchor {
color: var(--colorBlack400);
font-size: 0.8em;
font-weight: normal;
display: none;
}

h2, h3, h4, h5, h6 {
&:hover {
a.title-anchor {
display: inline;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<h{{ .Level }} id="{{ .Anchor }}">
{{ .Text | safeHTML }}
{{ if ne .Level 1 }}
<a class="title-anchor" href="#{{ .Anchor }}">🔗</a>
{{ end }}
</h{{ .Level }}>

0 comments on commit 8e3eeb5

Please sign in to comment.