From ca886e40752a8a30762708ea87d7228f737c0cd2 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Tue, 28 Dec 2021 19:28:08 +0000
Subject: [PATCH] fix render link for apostrophe
---
layouts/partials/backlinks.html | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/layouts/partials/backlinks.html b/layouts/partials/backlinks.html
index 16b96cd..daee6ec 100644
--- a/layouts/partials/backlinks.html
+++ b/layouts/partials/backlinks.html
@@ -4,13 +4,12 @@
{{$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 " " "-"}}
-
+ {{$cleanedInbound := apply (apply $inbound "index" "." "source") "replace" "." " " "-"}}
+ {{- range $cleanedInbound | uniq -}}
<li>
- <a href="{{$src | safeHTML}}">{{index . "source"}}</a>
+ <a href="{{.}}">{{index (index $contentTable .) "title"}}</a>
</li>
{{- end -}}
{{else}}
@@ -18,4 +17,4 @@
No backlinks found
</li>
{{end}}
-</ul>
\ No newline at end of file
+</ul>
--
Gitblit v1.10.0