mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-26 13:26:22 +00:00
22 lines
671 B
HTML
22 lines
671 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}}
|
|
{{- range $inbound -}}
|
|
{{$src := index . "source"}}
|
|
{{$src = replace $src " " "-"}}
|
|
|
|
<li>
|
|
<a href="{{$src}}">{{index (index $contentTable $src) "title"}}</a>
|
|
</li>
|
|
{{- end -}}
|
|
{{else}}
|
|
<li>
|
|
No backlinks found
|
|
</li>
|
|
{{end}}
|
|
</ul>
|