Skip to content

Commit

Permalink
dedupe backlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
jackyzha0 committed Dec 27, 2021
1 parent 3959234 commit 094ab9d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions content/notes/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
```
Expand Down
8 changes: 3 additions & 5 deletions layouts/partials/backlinks.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ <h3>Backlinks</h3>
{{$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}}">{{index (index $contentTable $src) "title"}}</a>
<a href="{{.}}">{{index (index $contentTable .) "title"}}</a>
</li>
{{- end -}}
{{else}}
Expand Down

0 comments on commit 094ab9d

Please sign in to comment.