2020-11-28 16:28:30 -08:00
|
|
|
|
{{- $text_link := .Text -}}
|
|
|
|
|
|
|
|
|
|
{{ $_ := newScratch }}
|
|
|
|
|
{{- range $k, $v := .Page.Site.Data.sandpointsnamegraph -}}
|
|
|
|
|
{{ $_.Add "triads" $k }}
|
|
|
|
|
{{- end -}}
|
|
|
|
|
|
2022-01-08 03:16:27 -08:00
|
|
|
|
{{- if strings.HasPrefix .Destination "img:" -}}
|
|
|
|
|
{{- $img_params := (substr .Destination 4) -}}
|
|
|
|
|
{{- $img_src := index (split $img_params " ") 0 -}}
|
|
|
|
|
{{- $img_attr := index (split $img_params $img_src) 1 -}}
|
2022-01-10 15:40:38 -08:00
|
|
|
|
<img src="{{ $img_src }}" {{ $img_attr | safeHTMLAttr }} />
|
|
|
|
|
{{- else if strings.HasPrefix .Destination "vid:" -}}
|
|
|
|
|
{{- $vid_params := (substr .Destination 4) -}}
|
|
|
|
|
{{- $vid_src := index (split $vid_params " ") 0 -}}
|
|
|
|
|
{{- $vid_attr := index (split $vid_params $vid_src) 1 -}}
|
|
|
|
|
<video controls src="{{ $vid_src }}" {{ $vid_attr | safeHTMLAttr }}></video>
|
2022-01-08 03:16:27 -08:00
|
|
|
|
{{- else if strings.HasPrefix .Destination "bib:" -}}
|
2020-12-14 17:11:58 -08:00
|
|
|
|
{{- $destination := (substr .Destination 4) -}}
|
|
|
|
|
{{- $c_prefix := .Page.Site.Params.sandpointsCatalogPrefix | default "/library/" -}}
|
|
|
|
|
{{- if index $.Page.Site.Data.books.catalog $destination -}}
|
|
|
|
|
{{- $b := index $.Page.Site.Data.books.catalog $destination -}}
|
|
|
|
|
{{- $bibhref := printf "%sBROWSE_LIBRARY.html#/book/%s" (safeURL ($c_prefix)) $destination }}
|
|
|
|
|
{{ $bibtitle := "" }}
|
|
|
|
|
{{ with $b.title }}
|
|
|
|
|
{{- $bibtitle = printf "%s" $b.title }}
|
|
|
|
|
{{ end }}
|
|
|
|
|
{{ .Page.Scratch.Add "bibs" (slice (slice $bibhref $bibtitle)) }}
|
|
|
|
|
{{- if not $text_link -}}
|
2021-09-02 02:59:14 -07:00
|
|
|
|
<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>
|
2021-05-18 16:26:07 -07:00
|
|
|
|
{{- else -}}
|
|
|
|
|
<span class="sup">bib⁄</span><a href="{{- $c_prefix | safeURL -}}BROWSE_LIBRARY.html#/book/{{- $destination -}}"{{- with $b.title}} title="{{- . -}}"{{- end -}} target="_blank">{{- $text_link -}}</a>
|
2020-11-28 16:28:30 -08:00
|
|
|
|
{{- end -}}
|
2020-12-14 17:11:58 -08:00
|
|
|
|
{{- else -}}
|
2021-05-18 16:26:07 -07:00
|
|
|
|
<a href="{{- $c_prefix | safeURL -}}BROWSE_LIBRARY.html#/book/{{- $destination -}}"{{- with .Title}} title="{{- . -}}"{{- end -}}>{{- $text_link -}}⦚<span>bib:{{- $destination -}} not found</span></a>
|
2020-12-14 17:11:58 -08:00
|
|
|
|
{{- end -}}
|
2020-11-28 16:28:30 -08:00
|
|
|
|
{{- else if in ($_.Get "triads") (index (split .Destination ":") 0) -}}
|
2020-12-14 17:11:58 -08:00
|
|
|
|
{{- if $.Page.Site.GetPage (printf "/%s" (replace .Destination ":" "/")) -}}
|
|
|
|
|
{{- $session := $.Page.Site.GetPage (printf "/%s" (replace .Destination ":" "/")) -}}
|
|
|
|
|
{{ .Page.Scratch.Add "links" (slice $session) }}
|
|
|
|
|
{{- if not $text_link -}}
|
2021-03-27 17:40:09 -07:00
|
|
|
|
<a class="triadlink" repoid="{{- $session.File.UniqueID -}}" printhref="#ph-{{- $session.File.UniqueID -}}" 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>
|
2020-11-28 16:28:30 -08:00
|
|
|
|
{{- else -}}
|
2021-03-27 17:40:09 -07:00
|
|
|
|
<a class="triadlink" repoid="{{- $session.File.UniqueID -}}" printhref="#ph-{{- $session.File.UniqueID -}}" 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>
|
2020-11-28 16:28:30 -08:00
|
|
|
|
{{- end -}}
|
2020-12-14 17:11:58 -08:00
|
|
|
|
{{- else -}}
|
2021-02-10 18:12:11 -08:00
|
|
|
|
<a href="{{- .Destination -}}/{{- if eq hugo.Environment "offline" -}}index.html{{- end -}}">{{- $text_link -}}⦚<span>{{- .Destination -}} not found</span></a>
|
2020-12-14 17:11:58 -08:00
|
|
|
|
{{- end -}}
|
2020-11-28 16:28:30 -08:00
|
|
|
|
{{- else if strings.HasPrefix .Destination "audio:" -}}
|
2020-12-14 17:11:58 -08:00
|
|
|
|
{{- $a_destination := (substr .Destination 6) -}}
|
|
|
|
|
{{- if findRE "^.*static" $a_destination -}}
|
|
|
|
|
<span class="soundcite" data-url="{{- (replaceRE "^.*static" "" $a_destination ) | safeURL -}}">{{ .Text }}</span>
|
|
|
|
|
{{- else -}}
|
|
|
|
|
<span class="soundcite" data-url="{{- $a_destination | safeURL -}}">{{ .Text }}</span>
|
|
|
|
|
{{- end -}}
|
2020-11-28 16:28:30 -08:00
|
|
|
|
{{- 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 -}}
|