forked from jakub/jakubb-hugo
38 lines
1005 B
HTML
38 lines
1005 B
HTML
{{ partial "header.html" . }}
|
|
{{ partial "nav.html" . }}
|
|
<div class="content">
|
|
|
|
<h1>{{ .Title }}</h1>
|
|
{{ .Content }}
|
|
|
|
|
|
{{ $path := .Page.File.Path | strings.TrimSuffix (path.Ext .Page.File.Path) }}
|
|
{{ $path := printf "%s/*" $path }}
|
|
{{ $images := where (resources.Match $path ) "ResourceType" "eq" "image" }}
|
|
<div class="gallery">
|
|
{{ range $images }}
|
|
<div class="gallery-item">
|
|
{{ $thumbnail := .Process "resize x400 q50 jpeg" }}
|
|
{{ $public := .Process "resize 2160x jpeg" }}
|
|
<a href="{{ $public.RelPermalink }}" target="_blank"><img src="{{ $thumbnail.RelPermalink }}" /></a>
|
|
</div>
|
|
{{ end }}
|
|
</div>
|
|
|
|
{{ $file:= .Page.Params.archive }}
|
|
{{ with $file }}
|
|
|
|
{{ if not (resources.Get $file) }}
|
|
{{ errorf "Error: 'file' is a required parameter." }}
|
|
{{ end }}
|
|
|
|
<p>{{ i18n "gallery.download" }}</p>
|
|
{{- with resources.Get $file -}}
|
|
<a class="button" href="{{ .RelPermalink }}" download>Download {{ path.Ext $file }}</a>
|
|
{{- end -}}
|
|
{{ end }}
|
|
|
|
|
|
</div>
|
|
{{ partial "footer.html" . }}
|