diff --git a/layouts/partials/list-item.html b/layouts/partials/list-item.html index d11de21..bdc5ff1 100644 --- a/layouts/partials/list-item.html +++ b/layouts/partials/list-item.html @@ -4,19 +4,19 @@ {{- $url := "" -}} {{- $anchor := "" -}} {{- $btext := "" -}} + {{- $btitle := "" -}} {{- if reflect.IsMap . -}} {{- $anchor = .anchor -}} {{- $page = .page -}} - {{- with .btext -}} - {{- $btext = printf " (%s)" . -}} - {{- end -}} + {{- with .btext -}}{{- $btext = printf " (%s)" . -}}{{- end -}} + {{- $btitle = .btitle -}} {{- end -}} {{- if ne $anchor "" -}} {{- $url = printf "%s#%v" $page.Permalink $anchor -}} {{- else -}} {{- $url = $page.Permalink -}} - {{- end -}} - {{ $page.Title }}{{ $btext }}   + {{- end -}} + {{ $page.Title }}{{ $btext }}   {{ if $page.Date -}} {{ $page.Date.Format (i18n "dateFormat") }} {{- else if $page.Params.Teaser -}}{{ $page.Params.Teaser }} diff --git a/layouts/shortcodes/ilink.html b/layouts/shortcodes/ilink.html index 3ee426c..aa35bc5 100644 --- a/layouts/shortcodes/ilink.html +++ b/layouts/shortcodes/ilink.html @@ -6,6 +6,7 @@ {{- $pages := where .Site.RegularPages "Params.pageid" "eq" $pid -}} {{- $fragsep := cond (eq $frag "") "" "#" -}} {{- $btext := or (.Get "btext") (printf "%d" $linkid) -}} +{{- $btitle := .Get "btitle" -}} {{- $anchor := printf "link-%d" $linkid -}} {{- $inner := .Inner -}} {{- range $pages -}} @@ -13,5 +14,5 @@ {{- $text := or $inner .Title -}} {{ $text | markdownify }} - {{- .Scratch.Add "backlinks" (slice (dict "anchor" $anchor "page" $this "btext" $btext)) -}} + {{- .Scratch.Add "backlinks" (slice (dict "anchor" $anchor "page" $this "btext" $btext "btitle" $btitle)) -}} {{- end -}}