From aa7c486e76ec119fa6a73cdeb01789a9ba67aa19 Mon Sep 17 00:00:00 2001 From: Alex Shpak Date: Sat, 30 May 2020 20:50:08 +0200 Subject: Add anchors to headings --- layouts/_default/_markup/render-heading.html | 4 ++++ layouts/_default/_markup/render-link.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 layouts/_default/_markup/render-heading.html (limited to 'layouts/_default') diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html new file mode 100644 index 0000000..5439d20 --- /dev/null +++ b/layouts/_default/_markup/render-heading.html @@ -0,0 +1,4 @@ + + {{ .Text | safeHTML }} + # + diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html index 4995a32..464fa1a 100644 --- a/layouts/_default/_markup/render-link.html +++ b/layouts/_default/_markup/render-link.html @@ -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 }} -- cgit v1.2.3