Add anchors to headings
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
<h{{ .Level }} id="{{ .Anchor | safeURL }}">
|
||||
{{ .Text | safeHTML }}
|
||||
<a class="anchor" href="#{{ .Anchor | safeURL }}">#</a>
|
||||
</h{{ .Level }}>
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
{{- define "portable-link" -}}
|
||||
{{- $destination := .Destination }}
|
||||
{{- $isRemote := or (in .Destination "://") (strings.HasPrefix .Destination "//") }}
|
||||
{{- $isRemote := or (in .Destination ":") (strings.HasPrefix .Destination "//") }}
|
||||
{{- if not $isRemote }}
|
||||
{{- $url := urls.Parse .Destination }}
|
||||
{{- $path := strings.TrimSuffix "/_index.md" $url.Path }}
|
||||
|
||||
Reference in New Issue
Block a user