{{ $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 "session:" }}
{{ $s_destination := (substr .Destination 9) }}
{{ if $.Page.Site.GetPage $s_destination }}
{{ $session := $.Page.Site.GetPage $s_destination }}
{{ if not $text_link }}
{{ $session.Title }}
{{ else }}
{{ $text_link }}
{{ end }}
{{ else }}
{{ $text_link }}⦚session:{{ $s_destination }} not found
{{ end }}
{{ else if strings.HasPrefix .Destination "topic:" }}
{{ $t_destination := (substr .Destination 6) }}
{{ if $.Page.Site.GetPage $t_destination }}
{{ $topic := $.Page.Site.GetPage $t_destination }}
{{ if not $text_link }}
{{ $topic.Title }}
{{ else }}
{{ $text_link }}
{{ end }}
{{ else }}
{{ $text_link }}⦚topic:{{ $t_destination }} not found
{{ end }}
{{ else if findRE "^.*static" .Destination }}
{{ else }}
{{ end }}