Update gallery page
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
<section class="hero">
|
||||
<h1 class="title">{{ .Title }}</h1>
|
||||
{{ partial "components/meta/index.html" . }}
|
||||
{{ partial "components/image/index.html" (dict "page" .Page "image" .Params.hero) }}
|
||||
|
||||
{{ $hero := partial "components/hero/process.html" .Params.hero }}
|
||||
{{ $data := partial "components/image/process.html" (dict "page" .Page "src" $hero.src) }}
|
||||
{{ partial "components/image/index.html" (merge $data $hero) }}
|
||||
</section>
|
||||
|
||||
15
layouts/partials/components/hero/process.html
Normal file
15
layouts/partials/components/hero/process.html
Normal file
@@ -0,0 +1,15 @@
|
||||
{{- $src := "" -}}
|
||||
{{- $caption := "" -}}
|
||||
{{- $title := "" -}}
|
||||
{{- $alt := "" -}}
|
||||
|
||||
{{- if reflect.IsMap . -}}
|
||||
{{- $src = .src -}}
|
||||
{{- $caption = .caption | default "" -}}
|
||||
{{- $title = .title | default $caption | plainify -}}
|
||||
{{- $alt = .alt | default $title | plainify -}}
|
||||
{{- else -}}
|
||||
{{- $src = . -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- return (dict "src" $src "caption" $caption "title" $title "alt" $alt) -}}
|
||||
Reference in New Issue
Block a user