14 lines
564 B
HTML
14 lines
564 B
HTML
{{- $this := $.Page -}}
|
|
{{- $pid := or (.Get "pid") (.Get "pageid") -}}
|
|
{{- $pages := where .Site.RegularPages "Params.pageid" "eq" $pid -}}
|
|
{{- $frag := .Get "id" -}}
|
|
{{- $fragsep := cond (eq $frag "") "" "#" -}}
|
|
{{- $inner := .Inner -}}
|
|
{{- range $pages -}}
|
|
{{- $url := printf "%s%s%s" .Permalink $fragsep $frag -}}
|
|
{{- $text := or $inner .Title -}}
|
|
{{- $anchor := $text | anchorize -}}
|
|
<a id="{{ $anchor }}"
|
|
href="{{ $url }}">{{ $text | markdownify }}</a>
|
|
{{- .Scratch.Add "backlinks" (slice (dict "anchor" $anchor "page" $this)) -}}
|
|
{{- end -}}
|