{{ $text_link := .Text }} {{ .Destination }} {{ if strings.HasPrefix .Destination "bib:" }} {{ $destination := (substr .Destination 4) }} {{ if index $.Page.Site.Data.books.piratecarecollection $destination }} {{ $b := index $.Page.Site.Data.books.piratecarecollection $destination }} {{ if not $text_link }} {{ delimit $b.authors ", " " & " }}, {{ substr $b.pubdate 0 4}}.‘{{ $b.title }}’. {{ $b.publisher }}. {{ else }} {{ $text_link }} {{ end }} {{ else }} {{ $text_link }}⦚bib:{{ $destination }} not found {{ end }} {{ else if strings.HasPrefix .Destination "sesssion:" }} {{ $destination := (substr .Destination 9) }} {{ if $.Page.Site.GetPage $destination }} {{ $session := $.Page.Site.GetPage $destination }} {{ if not $text_link }} {{ $session.Title }} {{ else }} {{ $text_link }} {{ end }} {{ else }} {{ $text_link }}⦚session:{{ $destination }} not found {{ end }} {{ else if strings.HasPrefix .Destination "topic:" }} {{ $destination := (substr .Destination 6) }} {{ if $.Page.Site.GetPage $destination }} {{ $topic := $.Page.Site.GetPage $destination }} {{ if not $text_link }} {{ $topic.Title }} {{ else }} {{ $text_link }} {{ end }} {{ else }} {{ $text_link }}⦚topic:{{ $destination }} not found {{ end }} {{ else if findRE "^.*static" .Destination }} {{ .Text }} {{ else }} {{ .Text }} {{ end }}