Backlinks
{{$url := urls.Parse .Site.BaseURL }}
{{$host := strings.TrimRight "/" $url.Path }}
{{$curPage := strings.TrimPrefix $host (strings.TrimRight "/" .Page.RelPermalink)}}
{{$linkIndex := getJSON "/assets/indices/linkIndex.json"}}
{{$inbound := index $linkIndex.index.backlinks $curPage}}
{{$contentTable := getJSON "/assets/indices/contentIndex.json"}}
{{if $inbound}}
{{$backlinks := dict "SENTINEL" "SENTINEL"}}
{{range $k, $v := $inbound}}
{{$cleanedInbound := replace $v.source " " "-"}}
{{$ctx := $v.text}}
{{$backlinks = merge $backlinks (dict $cleanedInbound $ctx)}}
{{end}}
{{- range $lnk, $ctx := $backlinks -}}
{{$l := printf "%s%s/" $host $lnk}}
{{$l = cond (eq $l "//") "/" $l}}
{{with (index $contentTable $lnk)}}
-
{{index (index . "title")}}
{{end}}
{{- end -}}
{{else}}
-
No backlinks found
{{end}}