keroosha.cybergulag.today/layouts/partials/backlinks.html

21 lines
694 B
HTML
Raw Normal View History

<h3>Backlinks</h3>
<ul class="backlinks">
2021-08-12 16:29:35 +03:00
{{$url := urls.Parse .Site.BaseURL }}
{{$host := strings.TrimRight "/" $url.Path }}
{{$curPage := strings.TrimPrefix $host (strings.TrimRight "/" .Page.RelPermalink) }}
2021-07-18 16:35:42 +03:00
{{$inbound := index $.Site.Data.linkIndex.index.backlinks $curPage}}
{{$contentTable := $.Site.Data.contentIndex}}
{{if $inbound}}
2021-12-27 21:15:10 +03:00
{{$cleanedInbound := apply (apply $inbound "index" "." "source") "replace" "." " " "-"}}
{{- range $cleanedInbound | uniq -}}
<li>
2021-12-27 21:15:10 +03:00
<a href="{{.}}">{{index (index $contentTable .) "title"}}</a>
</li>
2021-07-18 16:35:42 +03:00
{{- end -}}
{{else}}
<li>
No backlinks found
</li>
{{end}}
</ul>