|
- {{- $text_link := .Text -}}
-
- {{ $_ := newScratch }}
- {{- range $k, $v := .Page.Site.Data.sandpointsnamegraph -}}
- {{ $_.Add "triads" $k }}
- {{- end -}}
-
- {{- if strings.HasPrefix .Destination "bib:" -}}
- {{- $destination := (substr .Destination 4) -}}
- {{- $c_prefix := .Page.Site.Params.catalogprefix | default "/library/" -}}
- {{- if index $.Page.Site.Data.books.catalog $destination -}}
- {{- $b := index $.Page.Site.Data.books.catalog $destination -}}
- {{- if not $text_link -}}
- <span>{{- delimit $b.authors ", " " & " -}}{{- with $b.pubdate -}}, {{- substr . 0 4}}{{- end -}}.<a href="{{- $c_prefix | safeURL -}}BROWSE_LIBRARY.html#/book/{{- $destination -}}"{{- with $b.title}} title="{{- . -}}"{{- end -}} target="_blank"><span class="sup">bib⁄</span><i>‘{{- $b.title -}}’</i></a>. {{- with $b.publisher -}}{{- . -}}.{{- end -}}</span>
- {{- else -}}
- <a href="{{- $c_prefix | safeURL -}}BROWSE_LIBRARY.html#/book/{{- $destination -}}"{{- with $b.title}} title="{{- . -}}"{{- end -}} target="_blank">{{- $text_link -}}</a>
- {{- end -}}
- {{- else -}}
- <a href="{{- $c_prefix | safeURL -}}BROWSE_LIBRARY.html#/book/{{- $destination -}}"{{- with .Title}} title="{{- . -}}"{{- end -}}>{{- $text_link -}}⦚<span class="text-xs font-bold p-1 bg-AuChico text-CoconutCream">bib:{{- $destination -}} not found</span></a>
- {{- end -}}
- {{- else if in ($_.Get "triads") (index (split .Destination ":") 0) -}}
- {{- if $.Page.Site.GetPage (printf "/%s" (replace .Destination ":" "/")) -}}
- {{- $session := $.Page.Site.GetPage (printf "/%s" (replace .Destination ":" "/")) -}}
- {{- if not $text_link -}}
- <a href="{{- $session.RelPermalink -}}{{- if eq hugo.Environment "offline" -}}index.html{{- end -}}"{{- with $session.Title}} title="{{- $session.Title -}}"{{- end -}}><span class="sup">{{- index (split .Destination ":") 0 -}}⁄</span>{{- $session.Title -}}</a>
- {{- else -}}
- <a href="{{- $session.RelPermalink -}}{{- if eq hugo.Environment "offline" -}}index.html{{- end -}}"{{- with .Title}} title="{{- . -}}"{{- end -}}><span class="sup">{{- index (split .Destination ":") 0 -}}⁄</span>{{- $text_link -}}</a>
- {{- end -}}
- {{- else -}}
- <a href="{{- .Destination -}}/{{- if eq hugo.Environment "offline" -}}index.html{{- end -}}">{{- $text_link -}}⦚<span>{{- .Destination -}} not found</span></a>
- {{- end -}}
- {{- else if strings.HasPrefix .Destination "audio:" -}}
- {{- $a_parts := split (substr .Destination 6) "|" -}}
- {{- $a_destination := index ($a_parts) 0 -}}
- {{- if findRE "^.*static" $a_destination -}}
- <span class="soundcite" data-url="{{- (replaceRE "^.*static" "" $a_destination ) | safeURL -}}"
- {{- else if hasPrefix $a_destination "http" -}}
- <span class="soundcite" data-url="{{- $a_destination | safeURL -}}"
- {{- else -}}
- <span class="soundcite" data-id="{{- $a_destination -}}"
- {{- end -}}
- {{- if (gt (len $a_parts) 2) -}}
- data-start="{{ index ($a_parts) 1 }}" data-end="{{ index ($a_parts) 2 }}"
- {{- end -}}
- data-plays="1">{{ .Text }}</span>
- {{- else if findRE "^.*static" .Destination -}}
- <img src="{{- (replaceRE "^.*static" "" .Destination ) | safeURL -}}" alt="{{- .Text -}}" {{- with .Title}} title="{{- . -}}"{{- end -}} />
- {{- else -}}
- <img src="{{- .Destination | safeURL -}}" alt="{{- .Text -}}" {{- with .Title}} title="{{- . -}}"{{- end -}} />
- {{- end -}}
|