From e922b07aec2b9d45a8f8ecd5616614c385dc26b3 Mon Sep 17 00:00:00 2001 From: Will Faught Date: Sun, 24 Sep 2023 23:09:08 -0700 Subject: [PATCH] Fix link render target to have no whitespace --- layouts/_default/_markup/render-link.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html index dec0e3ff..bc9189ff 100644 --- a/layouts/_default/_markup/render-link.html +++ b/layouts/_default/_markup/render-link.html @@ -1,3 +1,6 @@ -{{ $target := partial "paige/target.html" (dict "page" .Page "url" .Destination) }} +{{- $href := cond (.Destination | not | not) (printf ` href="%s"` .Destination) "" -}} +{{- $target := partial "paige/target.html" (dict "page" .Page "url" .Destination) -}} +{{- $targetattr := cond ($target | not | not) (printf ` target="%s"` $target) "" -}} +{{- $title := cond (.Title | not | not) (printf ` title="%s"` .Title) "" -}} -{{ .Text }} +{{- printf `%s` $href $targetattr $title .Text | safeHTML -}}