hugo-theme-cybercards/layouts/shortcodes/embed.html

14 lines
527 B
HTML

{{- $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 -}}