From 094ab9d064b8e3d24f0cb656aaf4e0ea08365ac5 Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Mon, 27 Dec 2021 13:15:10 -0500 Subject: [PATCH] dedupe backlinks --- content/notes/config.md | 1 + layouts/partials/backlinks.html | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/content/notes/config.md b/content/notes/config.md index 6f5ef740b..a5c194fc8 100644 --- a/content/notes/config.md +++ b/content/notes/config.md @@ -29,6 +29,7 @@ To customize the Interactive Graph view, you can poke around `data/graphConfig.y enableLegend: false # automatically generate a legend enableDrag: true # allow dragging nodes in the graph enableZoom: true # allow zooming and panning the graph +depth: -1 # how many neighbours of the current node to show (-1 is all nodes) paths: # colour specific nodes path off of their path - /moc: "#4388cc" ``` diff --git a/layouts/partials/backlinks.html b/layouts/partials/backlinks.html index 9020bf7e8..daee6ec77 100644 --- a/layouts/partials/backlinks.html +++ b/layouts/partials/backlinks.html @@ -6,12 +6,10 @@ {{$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 -}}
  • - {{index (index $contentTable $src) "title"}} + {{index (index $contentTable .) "title"}}
  • {{- end -}} {{else}}