From 3583265f80afa081bf7a1fe996a9b3fe3c4e32e0 Mon Sep 17 00:00:00 2001
From: meleu <meleu@users.noreply.github.com>
Date: Mon, 04 Apr 2022 20:30:23 +0000
Subject: [PATCH] docs: warn about possible lost of customization
---
layouts/partials/backlinks.html | 24 +++++++++++++-----------
1 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/layouts/partials/backlinks.html b/layouts/partials/backlinks.html
index 48ffecc..425ec67 100644
--- a/layouts/partials/backlinks.html
+++ b/layouts/partials/backlinks.html
@@ -2,21 +2,23 @@
<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}}
+ {{$curPage := strings.TrimPrefix $host (strings.TrimRight "/" .Page.RelPermalink)}}
+ {{$linkIndex := getJSON "/assets/indices/linkIndex.json"}}
+ {{$inbound := index $linkIndex.index.backlinks $curPage}}
+ {{$contentTable := getJSON "/assets/indices/contentIndex.json"}}
{{if $inbound}}
- {{- range $inbound -}}
- {{$src := index . "source"}}
- {{$src = replace $src " " "-"}}
- {{$src = replace $src `\` ""}}
-
- <li>
- <a href="../{{$src | safeHTML}}">{{index . "source"}}</a>
- </li>
+ {{$cleanedInbound := apply (apply $inbound "index" "." "source") "replace" "." " " "-"}}
+ {{- range $cleanedInbound | uniq -}}
+ {{$l := printf "%s%s" $host .}}
+ {{with (index $contentTable .)}}
+ <li>
+ <a href="{{$l}}">{{index (index . "title")}}</a>
+ </li>
+ {{end}}
{{- end -}}
{{else}}
<li>
No backlinks found
</li>
{{end}}
-</ul>
\ No newline at end of file
+</ul>
--
Gitblit v1.10.0