mirror of
https://github.com/falsycat/ar.falsy.cat.git
synced 2024-11-14 23:44:52 +00:00
21 lines
694 B
HTML
21 lines
694 B
HTML
<h3>Backlinks</h3>
|
|
<ul class="backlinks">
|
|
{{$url := urls.Parse .Site.BaseURL }}
|
|
{{$host := strings.TrimRight "/" $url.Path }}
|
|
{{$curPage := strings.TrimPrefix $host (strings.TrimRight "/" .Page.RelPermalink) }}
|
|
{{$inbound := index $.Site.Data.linkIndex.index.backlinks $curPage}}
|
|
{{$contentTable := $.Site.Data.contentIndex}}
|
|
{{if $inbound}}
|
|
{{$cleanedInbound := apply (apply $inbound "index" "." "source") "replace" "." " " "-"}}
|
|
{{- range $cleanedInbound | uniq -}}
|
|
<li>
|
|
<a href="{{.}}">{{index (index $contentTable .) "title"}}</a>
|
|
</li>
|
|
{{- end -}}
|
|
{{else}}
|
|
<li>
|
|
No backlinks found
|
|
</li>
|
|
{{end}}
|
|
</ul>
|