Compare commits

..

3 commits

5 changed files with 65 additions and 44 deletions

View file

@ -4,4 +4,5 @@ date: 2024-02-13
layout: locations layout: locations
--- ---
Test This page shows a geospatial visualisation of where the various things recorded
on this site took place.

View file

@ -2,13 +2,13 @@
{{- $location := .Params.location }} {{- $location := .Params.location }}
{{- range $k, $v := $locations -}} {{- range $k, $v := $locations -}}
{{- if ( isset $v "lat" ) -}} {{- if ( isset $v "lat" ) -}}
{{- partialCached "util/get_location_by_index.html" ( dict "locations" $v "location" $location ) $location -}} {{- partialCached "util/get_location_by_index.html" ( dict "locations" $v "location" $location ) $location -}}
{{- else if ( eq $k $location ) -}} {{- else if ( eq $k $location ) -}}
{{- with $v -}} {{- with $v -}}
{{- return . -}} {{- return . -}}
{{- else -}} {{- else -}}
{{- warnf "Location %q has no co-ordinates set" $k -}} {{- warnf "Location %q has no co-ordinates set" $k -}}
{{- end -}}
{{- end -}} {{- end -}}
{{- end -}}
{{- end -}} {{- end -}}

View file

@ -41,12 +41,14 @@
{{- end -}} {{- end -}}
{{- range $k, $v := .items -}} {{- range $k, $v := .items -}}
{{- if not ( isset $v "redact" ) -}}
<li itemscope itemtype="https://schema.org/Place"> <li itemscope itemtype="https://schema.org/Place">
{{- $k -}} {{- $k -}}
{{- if ( not ( isset $v "lat" ) ) -}} {{- if ( not ( isset $v "lat" ) ) -}}
{{- partial "util/render_recursive_list.html" ( dict "sc" $.sc "pc" $.pc "items" $v "schemaType" $schemaType "listType" $listType ) -}} {{- partial "util/render_recursive_list.html" ( dict "sc" $.sc "pc" $.pc "items" $v "schemaType" $schemaType "listType" $listType ) -}}
{{- end -}} {{- end -}}
</li> </li>
{{- end -}}
{{- end -}} {{- end -}}
{{- if ( eq $listType "unordered" ) -}} {{- if ( eq $listType "unordered" ) -}}

View file

@ -1,29 +1,32 @@
{{- /* {{- /*
Renders a block quotation. Renders a block quotation.
@params style Force a blockquote style. Optional. @params style Force a blockquote style. Optional.
@params cite URI for work. Optional. @params cite URI for work. Optional.
@params source The speaker(s) of the quotation. @params source The speaker(s) of the quotation.
For works cited (optional): For works cited (optional):
@params ibid Whether to use ibidem as the source. Optional. @params ibid Whether to use ibidem as the source. Optional.
@see partials/cite.html for full list of args. @see partials/cite.html for full list of args.
For works cited that form part of a series (optional): For works cited that form part of a series (optional):
@params schemaTypeSeries The Schema.org `itemtype` value for the work series. Default 'CreativeWork'. Optional. @params schemaTypeSeries The Schema.org `itemtype` value for the work series. Default 'CreativeWork'. Optional.
@params titleSeries Title of the work series to display. Optional. @params titleSeries Title of the work series to display. Optional.
@params citeSeries URI for work series. Optional. @params citeSeries URI for work series. Optional.
@params titleSeriesLang Language code of a foreign-language work series' title. Optional. @params titleSeriesLang Language code of a foreign-language work series' title. Optional.
@params titleSeriesTr English translation of a foreign-language work series' title. Optional. @params titleSeriesTr English translation of a foreign-language work series' title. Optional.
@params numberSeries The number or code of the quoted work within its series. Optional. @params numberSeries The number or code of the quoted work within its series. Optional.
*/ -}} */
-}}
{{- $valid_styles := slice "" "epigram" "script" -}} {{- $valid_styles := slice "" "epigram" "script" -}}
<!-- Variable assignment --> <!-- Variable assignment -->
{{- $style := default "" ( index .Params "style" ) -}} {{- $style := default "" ( index .Params "style" ) -}}
{{- $cite := default "" ( index .Params "cite" ) -}} {{- $cite := default "" ( index .Params "cite" ) -}}
{{- $href := default "" ( index .Params "href" ) -}}
{{- $ibid := default false ( index .Params "ibid" ) -}} {{- $ibid := default false ( index .Params "ibid" ) -}}
{{- $source := .Params.source -}} {{- $source := .Params.source -}}
@ -32,6 +35,7 @@
{{- $hasCitedWork := ( isset .Params "title" ) }} {{- $hasCitedWork := ( isset .Params "title" ) }}
{{- $hasCitedSeries := ( isset .Params "titleSeries" ) -}} {{- $hasCitedSeries := ( isset .Params "titleSeries" ) -}}
<!-- Validation --> <!-- Validation -->
{{- if ( not ( in $valid_styles $style ) ) -}} {{- if ( not ( in $valid_styles $style ) ) -}}
@ -43,37 +47,51 @@
{{- end -}} {{- end -}}
{{- if ( not ( isset $.Params "cite" ) ) -}} {{- if ( not ( isset $.Params "cite" ) ) -}}
{{- erroridf "missing-cite" "No cite found for blockquote (%q)" .Page.File.Path -}} {{- erroridf "missing-cite" "No cite found for blockquote (%q)" .Page.File.Path -}}
{{- end -}} {{- end -}}
<!-- Rendering --> <!-- Rendering -->
<figure <figure
class="figure--blockquote blockquote{{- with $style }} blockquote--{{- . -}}{{- end -}}" class="figure--blockquote blockquote{{- with $style }} blockquote--{{- . -}}{{- end -}}"
itemscope itemscope
itemtype="Quotation" itemtype="Quotation"
role="group"> role="group"
>
<blockquote <blockquote
class="blockquote__body" class="blockquote__body"
{{- with $cite }} cite="{{ . }}"{{- end -}}> {{- with $cite }}cite="{{ . }}"{{- end -}}
>
{{- .Inner | .Page.RenderString -}} {{- .Inner | .Page.RenderString -}}
</blockquote> </blockquote>
<figcaption class="blockquote__caption{{- if $isSourceHidden }} blockquote__caption--hidden{{- end -}}"> <figcaption class="blockquote__caption{{- if $isSourceHidden }}blockquote__caption--hidden{{- end -}}">
{{- if $ibid -}} {{- if $ibid -}}
<abbr lang="la" title="ibīdem [in the same place]">Ibid.</abbr> <abbr
{{- else if $source -}} lang="la"
<span temprop="spokenByCharacter">{{- $source | safeHTML -}}</span> title="ibīdem [in the same place]"
{{- if $hasCitedWork -}}, <span itemprop="isBasedOn">{{- partial "cite.html" . -}} >Ibid.</abbr
{{- if $hasCitedSeries }} ( >
{{- .Scratch.Set "cite" .Params.citeSeries -}} {{- else if $source -}}
{{- .Scratch.Set "title" .Params.titleSeries -}} <span temprop="spokenByCharacter">{{- $source | safeHTML -}}</span>
{{- .Scratch.Set "titleLang" .Params.titleSeriesLang -}} {{- if $hasCitedWork -}}
{{- .Scratch.Set "titleTr" .Params.titleSeriesTr -}} ,
{{- .Scratch.Set "schemaType" .Params.schemaTypeSeries -}} <span itemprop="isBasedOn"
{{- partial "cite.html" . -}} >{{- partial "cite.html" . -}}
{{- with .Params.numberSeries }}, {{ . | safeHTML -}}{{- end -}} {{- if $hasCitedSeries }}
){{- end -}}</span> (
{{- .Scratch.Set "cite" .Params.citeSeries -}}
{{- .Scratch.Set "title" .Params.titleSeries -}}
{{- .Scratch.Set "titleLang" .Params.titleSeriesLang -}}
{{- .Scratch.Set "titleTr" .Params.titleSeriesTr -}}
{{- .Scratch.Set "schemaType" .Params.schemaTypeSeries -}}
{{- .Scratch.Set "href" .Params.hrefSeries -}}
{{- partial "cite.html" . -}}
{{- with .Params.numberSeries }}, {{ . | safeHTML -}}{{- end -}}
)
{{- end -}}</span
>
{{- end -}}
{{- end -}} {{- end -}}
{{- end -}}
</figcaption> </figcaption>
</figure> </figure>

View file

@ -32,7 +32,7 @@
{{- if or ( .Get "caption" ) ( .Get "title" ) -}} {{- if or ( .Get "caption" ) ( .Get "title" ) -}}
<figcaption class="figure__caption{{ if not ( or ( .Get "caption" ) ( .Get "title" ) ) }}figure__caption--no-height{{ end }}"> <figcaption class="figure__caption{{ if not ( or ( .Get "caption" ) ( .Get "title" ) ) }}figure__caption--no-height{{ end }}">
{{- with .Get "title" -}}<h4 class="figcaption__title">{{ . | markdownify | safeHTML }}</h4>{{- end -}} {{- with .Get "title" -}}<h4 class="figcaption__title">{{ . | markdownify | safeHTML }}</h4>{{- end -}}
{{- with .Get "caption" -}}<p class="figcaption__caption">{{ . | markdownify | safeHTML }}</p>{{- end -}} {{- with .Get "caption" -}}<p class="figcaption__caption">{{ . | $.Page.RenderString }}</p>{{- end -}}
</figcaption> </figcaption>
{{- end -}} {{- end -}}
</figure> </figure>