Skip to content

Commit

Permalink
Adding heading self link (#1487)
Browse files Browse the repository at this point in the history
* Adding heading self link

* Change self heading url
  • Loading branch information
esthermmoturi authored Aug 12, 2024
1 parent 6ca992a commit 1942e24
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion assets/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19233,7 +19233,7 @@ nav.foldable-nav .with-child ul {
text-decoration: none;
visibility: hidden; }
.td-heading-self-link:before {
content: '#'; }
content: '🔗'; }
@media (hover: none) and (pointer: coarse), (max-width: 576px) {
.td-heading-self-link {
visibility: visible; } }
Expand Down
8 changes: 8 additions & 0 deletions layouts/_default/_markup/render-heading.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<h{{ .Level }} id="{{- .Anchor | safeURL -}}">
{{- .Text | safeHTML -}}
{{ template "_default/_markup/_td-heading-self-link.html" . -}}
</h{{ .Level }}>

{{- define "_default/_markup/_td-heading-self-link.html" -}}
<a class="td-heading-self-link" href="#{{ .Anchor | safeURL }}" aria-label="Heading self-link"></a>
{{- end -}}

0 comments on commit 1942e24

Please sign in to comment.