{{- $currentPage := .Page -}} {{- $text := .Text -}} {{- $destination := .Destination -}} {{- $u := urls.Parse $destination -}} {{- if not $u.Scheme -}} {{- with site.GetPage .Destination -}} {{- $backlinks := .Store.Get "backlinks" | default slice -}} {{- $backlinks := $backlinks|append $currentPage.RelPermalink -}} {{- .Store.Set "backlinks" ($backlinks|uniq) -}} {{- if not $text -}} {{- $text = .LinkTitle -}} {{- end -}} {{- .Section -}}⁄{{- $text -}} {{- end -}} {{- if hasPrefix $destination "/library" -}} {{- $bib := strings.TrimPrefix "/library/" $destination -}} {{- $b := index site.Data.books.catalog $bib -}} {{- if not $text -}} {{- $text = $b.title|default "" -}} {{- end -}} library⁄{{- $text -}} {{- end -}} {{- else -}} www⁄{{- with .Text }}{{ . }}{{- end -}} {{- end -}} {{- /* chomp trailing newline */ -}}