From 3d541cb37cbe24c9b5552030b2c003375de2f19a Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Mon, 18 Nov 2024 09:19:03 +0100 Subject: [PATCH] ilink shortcode: add prefix parameter --- layouts/shortcodes/ilink.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/layouts/shortcodes/ilink.html b/layouts/shortcodes/ilink.html index bf31ad1..a449905 100644 --- a/layouts/shortcodes/ilink.html +++ b/layouts/shortcodes/ilink.html @@ -7,6 +7,7 @@ {{- $fragsep := cond (eq $frag "") "" "#" -}} {{- $btext := or (.Get "btext") (printf "%d" $linkid) -}} {{- $btitle := .Get "btitle" -}} +{{- $prefix := .Get "prefix" -}} {{- $anchor := printf "link-%d" $linkid -}} {{- $inner := .Inner -}} {{- $linkTitle := (.Get "title") -}} @@ -14,6 +15,6 @@ {{- $url := printf "%s%s%s" .Permalink $fragsep $frag -}} {{- $text := or $inner .Title -}} {{ $text | markdownify }} + href="{{ $url }}">{{ with $prefix }}{{ markdownify . }} {{ end }}{{ $text | markdownify }} {{- .Scratch.Add "backlinks" (slice (dict "anchor" $anchor "page" $this "btext" $btext "btitle" $btitle)) -}} {{- end -}}