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