hugo-theme-zzo/layouts/gallery/single.html

60 lines
1.6 KiB
HTML
Raw Normal View History

2019-11-04 13:09:44 +00:00
{{ define "main" }}
2020-02-13 11:44:18 +00:00
<header class="header basicflex-column">
2019-11-04 13:09:44 +00:00
<h3 class="terms__title h3">{{ .Title }}</h3>
<div class="gallery__contents">
{{ .Content }}
</div>
</header>
2019-11-22 07:29:07 +00:00
{{ $root := . }}
{{ if in (lower .Params.Mode) "one" }}
2019-11-04 13:09:44 +00:00
<main class="gallery main">
<div class="grid gallery__container">
2019-11-04 13:09:44 +00:00
<div class="grid-sizer"></div>
{{ if .File.Dir }}
{{ $basename := (replace .File.Dir "\\" "/") }}
{{ range .Params.Images }}
<div class="grid-item">
<img src="{{ $basename | relURL }}{{ .image }}" alt="{{ print .caption }}" />
<div class="grid-item__desc hide">
<span class="grid-item__desc--text">
{{ .caption }}
</span>
</div>
</div>
{{ end }}
2019-11-04 13:09:44 +00:00
{{ end }}
2020-01-24 12:24:17 +00:00
</div>
2019-11-04 13:09:44 +00:00
{{ partial "pagination/pagination-single" . }}
</main>
{{ else }}
<main class="gallery main">
<div class="grid gallery__container">
<div class="grid-sizer"></div>
{{ if .File.Dir }}
{{ $basename := (replace .File.Dir "\\" "/") }}
{{ range (readDir (print "./static/" $basename)) }}
<div class="grid-item">
<img src="{{ $basename | relURL }}{{ .Name }}" alt="{{ index (split .Name ".") 0 }}"/>
<div class="grid-item__desc hide">
<span class="grid-item__desc--text">
{{ index (split .Name ".") 0 }}
</span>
</div>
</div>
{{ end }}
{{ end }}
</div>
{{ partial "pagination/pagination-single" . }}
</main>
{{ end }}
<div class="hide">
{{ partial "search/site-search" . }}
</div>
{{ partial "body/photoswipe" . }}
{{ partial "script/gallery-script" . }}
2019-11-04 13:09:44 +00:00
{{ end }}