From fa3803fe00e0beacd27e800ad8827708007532d3 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Thu, 27 Feb 2020 13:16:37 +0100 Subject: [PATCH] set data attribute to copy anchor url --- layouts/partials/content.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/partials/content.html b/layouts/partials/content.html index 1ca0cb3..73bc6fb 100644 --- a/layouts/partials/content.html +++ b/layouts/partials/content.html @@ -3,9 +3,9 @@ {{ $.Scratch.Set "content" (.Content | replaceRE `` `` | safeHTML) }} {{ if and $showAnchor $anchorLeft }} - {{ $.Scratch.Set "content" ($.Scratch.Get "content" | replaceRE "(]*>)(.*?)()" `${1}${3}${4}` | safeHTML) }} + {{ $.Scratch.Set "content" ($.Scratch.Get "content" | replaceRE "(]*>)(.*?)()" (printf `%s%s%s` `${1}` (absURL (printf "%s#%s" .Permalink `${2}`)) `${2}` `${3}` `${4}`) | safeHTML) }} {{ else if and $showAnchor (not $anchorLeft) }} - {{ $.Scratch.Set "content" ($.Scratch.Get "content" | replaceRE "(]*>)(.*?)()" `${1}${3}${4}` | safeHTML) }} + {{ $.Scratch.Set "content" ($.Scratch.Get "content" | replaceRE "(]*>)(.*?)()" (printf `%s%s%s` `${1}` `${3}` (absURL (printf "%s#%s" .Permalink `${2}`)) `${2}` `${4}`) | safeHTML) }} {{ end }} {{ $.Scratch.Get "content" }}