mirror of
https://gitlab.com/MisterBiggs/brain-quartz.git
synced 2025-08-14 01:21:38 +00:00
.github
assets
content
data
layouts
_default
partials
backlinks.html
contact.html
darkmode.html
footer.html
graph.html
head.html
page-list.html
popover.html
search.html
404.html
index.html
static
.gitignore
CODE_OF_CONDUCT.md
LICENSE.txt
Makefile
README.md
config.toml
22 lines
749 B
HTML
22 lines
749 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) }}
|
|
{{$linkIndex := getJSON "/static/linkIndex.json"}}
|
|
{{$inbound := index $linkIndex.index.backlinks $curPage}}
|
|
{{$contentTable := getJSON "/static/contentIndex.json"}}
|
|
{{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>
|