roadmap/layouts/partials/backlinks.html

21 lines
607 B
HTML
Raw Normal View History

<h3>Backlinks</h3>
<ul class="backlinks">
2021-08-12 13:29:35 +00:00
{{$url := urls.Parse .Site.BaseURL }}
{{$host := strings.TrimRight "/" $url.Path }}
{{$curPage := strings.TrimPrefix $host (strings.TrimRight "/" .Page.RelPermalink) }}
2021-07-18 13:35:42 +00:00
{{$inbound := index $.Site.Data.linkIndex.index.backlinks $curPage}}
{{if $inbound}}
2021-07-18 13:35:42 +00:00
{{- range $inbound -}}
{{$src := index . "source"}}
{{$src = replace $src " " "-"}}
<li>
2021-10-23 01:56:26 +00:00
<a href="{{$src | safeHTML}}">{{index . "source"}}</a>
</li>
2021-07-18 13:35:42 +00:00
{{- end -}}
{{else}}
<li>
No backlinks found
</li>
{{end}}
</ul>