Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Heading self-links: more compact, customizable, and reusable (#1831)
- Loading branch information
Showing
6 changed files
with
82 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{{ template "_default/_markup/td-render-heading.html" . -}} | ||
|
||
{{/* By default, the markdown processor emits a heading on its own line, so we | ||
don't trim whitespace from the end of this template. */}} |