{{- $pid := or (.Get "pid") (.Get "page") -}} {{- $this := $.Page -}} {{- $linkid := or ($this.Scratch.Get "linkid") 1 -}} {{- $this.Scratch.Set "linkid" (add $linkid 1) -}} {{- $pages := where .Site.RegularPages "Params.pageid" "eq" $pid -}} {{- $btext := or (.Get "btext") (printf "%d" $linkid) -}} {{- $btitle := .Get "btitle" -}} {{- range $pages -}} {{- .Scratch.Add "backlinks" (slice (dict "page" $this "btext" $btext "btitle" $btitle)) -}} ### [{{ .Title }}]({{ .Permalink }}) {{ .RenderShortcodes }} {{- end -}}