You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
749 B
HTML

<h3>Backlinks</h3>
<ul class="backlinks">
3 years ago
{{$url := urls.Parse .Site.BaseURL }}
{{$host := strings.TrimRight "/" $url.Path }}
{{$curPage := strings.TrimPrefix $host (strings.TrimRight "/" .Page.RelPermalink) }}
{{$linkIndex := getJSON "/static/linkIndex.json"}}
{{$inbound := index $linkIndex.index.backlinks $curPage}}
{{$contentTable := getJSON "/static/contentIndex.json"}}
{{if $inbound}}
3 years ago
{{$cleanedInbound := apply (apply $inbound "index" "." "source") "replace" "." " " "-"}}
{{- range $cleanedInbound | uniq -}}
<li>
3 years ago
<a href="{{.}}">{{index (index $contentTable .) "title"}}</a>
</li>
{{- end -}}
{{else}}
<li>
No backlinks found
</li>
{{end}}
</ul>