Take an .images list of resources in figures/fullwidth and figures/small
These two templates take a list of resources to operate on. Since these render image figures, that list is called "images".
This commit is contained in:
parent
a395d26bc4
commit
3248ac51d1
2 changed files with 5 additions and 7 deletions
|
@ -1,10 +1,8 @@
|
|||
{{- $resource := .page.Resources.GetMatch .name -}}
|
||||
{{- if not $resource }}
|
||||
{{ errorf "No resource named '%s'. %s" .name .page.Permalink }}
|
||||
{{ end -}}
|
||||
{# TODO: Accommodate multiple images here #}
|
||||
{{- $resource := index .images 0 -}}
|
||||
|
||||
{{- if eq $resource.ResourceType "image" -}}
|
||||
{{ partial "page/figures/fullwidth-image.html" (merge . (dict "resource" $resource)) }}
|
||||
{{ partial "page/figures/fullwidth-image.html" (merge . (dict "resource" $resource)) }}
|
||||
{{- else if eq $resource.ResourceType "video" -}}
|
||||
{{ partial "page/figures/fullwidth-video.html" (merge . (dict "resource" $resource)) }}
|
||||
{{- end -}}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{{- $page := .page -}}
|
||||
|
||||
{{- $shouldShowTitle := .shouldShowTitle -}}
|
||||
|
||||
{{- $resource := $page.Resources.GetMatch .name -}}
|
||||
{# TODO: Accommodate multiple images here. #}
|
||||
{{- $resource := index .images 0 -}}
|
||||
{{- if not $resource }}
|
||||
{{ errorf "No resource named '%s'. %s" .name .page.Permalink }}
|
||||
{{ end -}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue