fix relative link styling, change graph and backlinks to refer to name rather than path

This commit is contained in:
Jacky Zhao
2021-12-23 14:05:27 -08:00
parent e332d5f9a6
commit cca56fbd2b
4 changed files with 15 additions and 15 deletions

View File

@ -4,13 +4,14 @@
{{$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 " " "-"}}
<li>
<a href="{{$src}}">{{index . "source"}}</a>
<a href="{{$src}}">{{index (index $contentTable $src) "title"}}</a>
</li>
{{- end -}}
{{else}}
@ -18,4 +19,4 @@
No backlinks found
</li>
{{end}}
</ul>
</ul>