{{- $this := $.Page -}} {{- $pages := where .Site.RegularPages "Params.pageid" "eq" (.Get "pid") -}} {{- $frag := .Get "id" -}} {{- $fragsep := "" -}} {{- if ne $frag "" -}}{{- $fragsep = "#" -}}{{- end -}} {{- $inner := .Inner -}} {{- range $pages -}} {{- $url := printf "%s%s%s" .Permalink $fragsep $frag -}} {{- $text := or $inner .Title -}} {{ $text | markdownify }} {{- .Scratch.SetInMap "backlinks" (anchorize $text) $this -}} {{- end -}}