update theme

This commit is contained in:
Ben Goldsworthy 2023-04-08 12:57:21 -06:00
parent 2a0ecfc3ec
commit f9aaff71c0
10 changed files with 1302 additions and 49 deletions

View file

@ -0,0 +1,32 @@
{{ with where ( $.Site.Data.abbreviations .Params.abbr ) }}
{{ if ( or ( eq .Params.mode "shortTitle" ) ( eq .Params.mode "shortTitlePl" ) ) }}
<abbr class="abbr" title="
{{- if ( eq .Params.mode "shortTitle" ) }}
{{ .shortTitle }}
{{ else if ( eq .Params.mode "shortTitlePl" ) }}
{{ if .shortTitlePl }}{{ .shortTitlePl }}{{ else }}{{ .shortTitle }}s{{ end }}
{{ end -}}
">
{{- if ( eq .Params.mode "shortTitle" ) }}
{{ .shortTitle }}
{{ else if ( eq .Params.mode "shortTitlePl" ) }}
{{ if .shortTitlePl }}{{ .shortTitlePl }}{{ else }}{{ .shortTitle }}s{{ end }}
{{ end -}}
</abbr>
{{ else if ( or ( eq .Params.mode "longtitle" ) ( eq .Params.mode "longTitlePl" ) ) }}
{{- if ( eq .Params.mode "longTitle" ) }}
{{ .longTitle }}
{{ else if ( eq .Params.mode "longTitlePl" ) }}
{{ if .longTitlePl }}{{ .longTitlePl }}{{ else }}{{ .longTitle }}s{{ end }}
{{ end -}}
{{ else if ( or ( eq .Params.mode "fullTitle" ) ( eq .Params.mode "fullTitlePl" ) ) }}
{{ if ( eq .Params.mode "fullTitle" ) }}
{{ .longTitle }}&nbsp;(<abbr>{{ .short }}</abbr>)
{{ else if ( eq .Params.mode "fullTitlePl" ) }}
{{- if .longTitlePl }}{{ .longTitlePl }}{{ else }}{{ .longTitle }}s{{ end -}}
&nbsp;(<abbr>{{ if .shortPl }}{{ .shortPl }}{{ else }}{{ .short }}s{{ end }}</abbr>)
{{ end }}
{{ end }}
{{ else }}
{{ errorf "No definition found for abbreviation '%q'" .Params.abbr }}
{{ end }}

View file

@ -0,0 +1,16 @@
{{ if .Params.href }}
<a href="{{ if eq .Params.href "asCite" }}{{ .Params.cite }}{{ else }}{{ .Params.href }}{{end}}" target="_blank" rel="noopener noreferrer">
<cite class="cite {{ with .Params.citeStyle }}cite--{{ . }}{{ end }}"
{{ with .Params.cite }}cite="{{ . }}"{{ end }}
itemscope
itemtype="https://schema.org/
{{- with .Params.schemaType -}}
{{- . -}}
{{- else -}}
CreativeWork
{{- end -}}"
>
{{- .Params.title -}}
</cite>
</a>
{{ end }}

View file

@ -3,6 +3,9 @@
{{- end -}}
{{ $src := $.Page.Resources.GetMatch (.Get "src") }}
{{ if ( not $src ) }}
{{- errorf "No Page Resource found for src '%v' for post '%v'" ( .Get "src" ) $.Page.Title -}}
{{ end }}
{{ $linkedResource := $.Page.Resources.GetMatch (.Get "link") }}
<figure class="article__figure{{ with .Get "class" }} {{ . }}{{ end }}">
@ -34,15 +37,19 @@
{{- if eq $src.ResourceType "image" -}}
<picture class="figure__picture">
<img class="figure__image"
{{ with $src.Resize "1500x webp" }}
src="{{ .RelPermalink }}"
{{ if eq $src.MediaType.SubType "svg" }}
src="{{ $src.RelPermalink }}"
{{ else }}
{{ with $src.Resize "1500x webp" }}
src="{{ .RelPermalink }}"
{{ end }}
width="{{ $src.Width }}"
height="{{ $src.Height }}"
{{ end }}
{{- if or ($src.Params.alt) (.Get "caption") }}
alt="{{ with $src.Params.alt }}{{ . }}{{ else }}{{ .Get "caption" | markdownify | plainify }}{{ end }}"
{{- end -}}
{{- with $src.Params.title }} title="{{ . }}"{{ end -}}
width="{{ $src.Width }}"
height="{{ $src.Height }}"
/>
</picture>
{{- else if eq $src.ResourceType "video" -}}