Overhaul figures

This commit is contained in:
Will Faught
2023-01-06 14:11:48 -08:00
parent fd81ccccd5
commit cf823d7d63
13 changed files with 624 additions and 148 deletions

View File

@@ -0,0 +1,27 @@
{{ $page := .page }}
{{ $url := .url }}
{{ $resource := "" }}
{{ with $page.Resources.GetMatch $url }}
{{ $resource = . }}
{{ else }}
{{ with $page.Resources.Get (relLangURL $url) }}
{{ $resource = . }}
{{ else }}
{{ with resources.GetMatch $url }}
{{ $resource = . }}
{{ else }}
{{ with resources.Get (relLangURL $url) }}
{{ $resource = . }}
{{ else }}
{{ with resources.GetRemote $url }}
{{ $resource = . }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ if not $resource }}
{{ errorf "invalid resource: %q" $url }}
{{ end }}
{{ return $resource }}