{{- $text_link := .Text -}}
{{- 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 ", " " & " -}}{{- with $b.pubdate -}}, {{- substr . 0 4}}{{- end -}}.‘{{- $b.title -}}’. {{- with $b.publisher -}}{{- . -}}.{{- end -}}
{{- else -}}
{{- $text_link -}}
{{- end -}}
{{- else -}}
{{- $text_link -}}⦚bib:{{- $destination -}} not found
{{- end -}}
{{- else if strings.HasPrefix .Destination "session:" -}}
{{- $s_destination := printf "/session/%s" (substr .Destination 8) -}}
{{- 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 := printf "/topic/%s" (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 -}}