2021-07-18 13:02:53 -04:00
|
|
|
<h3>Backlinks</h3>
|
|
|
|
<ul class="backlinks">
|
2021-08-12 09:29:35 -04:00
|
|
|
{{$url := urls.Parse .Site.BaseURL }}
|
|
|
|
{{$host := strings.TrimRight "/" $url.Path }}
|
|
|
|
{{$curPage := strings.TrimPrefix $host (strings.TrimRight "/" .Page.RelPermalink) }}
|
2022-03-04 02:25:30 +00:00
|
|
|
{{$linkIndex := getJSON "/assets/indices/linkIndex.json"}}
|
2022-02-15 19:39:14 -05:00
|
|
|
{{$inbound := index $linkIndex.index.backlinks $curPage}}
|
2022-03-04 02:25:30 +00:00
|
|
|
{{$contentTable := getJSON "/assets/indices/contentIndex.json"}}
|
2021-07-18 13:02:53 -04:00
|
|
|
{{if $inbound}}
|
2021-12-27 13:15:10 -05:00
|
|
|
{{$cleanedInbound := apply (apply $inbound "index" "." "source") "replace" "." " " "-"}}
|
|
|
|
{{- range $cleanedInbound | uniq -}}
|
2021-10-22 14:04:09 -07:00
|
|
|
<li>
|
2022-02-28 08:24:29 -08:00
|
|
|
<a href="{{$url}}{{.}}">{{index (index $contentTable .) "title"}}</a>
|
2021-10-22 14:04:09 -07:00
|
|
|
</li>
|
2021-07-18 09:35:42 -04:00
|
|
|
{{- end -}}
|
2021-07-18 13:02:53 -04:00
|
|
|
{{else}}
|
|
|
|
<li>
|
|
|
|
No backlinks found
|
|
|
|
</li>
|
|
|
|
{{end}}
|
2021-12-23 14:05:27 -08:00
|
|
|
</ul>
|