Bunch of misc photos template clean up

This commit is contained in:
Eryn Wells 2022-10-21 11:09:30 -07:00
parent f23b047a0f
commit 5bfa439700
2 changed files with 23 additions and 32 deletions

View file

@ -5,14 +5,12 @@
{{ define "main" }}
{{- $pages := (.Paginate (first 50 (.Pages.GroupByDate "January 2006"))).PageGroups -}}
{{- range $pages -}}
<section class="photos">
<h6>{{ .Key | title }}</h6>
<ul class="grid">
{{- range .Pages -}}
{{- .Render "li_thumbnail_in_grid" -}}
{{- end -}}
</ul>
</section>
<h6>{{ .Key | title }}</h6>
<ul class="grid">
{{- range .Pages -}}
{{- .Render "li_thumbnail_in_grid" -}}
{{- end -}}
</ul>
{{- end -}}
{{ end }}

View file

@ -3,16 +3,13 @@
{{ end }}
{{ define "main" }}
<article class="post-single">
<nav class="post-nav">
<a class="back" href="{{ ref . `photos` }}">Back</a>
</nav>
<nav><a class="back" href="{{ ref . `photos` }}">Back</a></nav>
{{ if .Title }}
<header>
{{ partial "development/draft_tag.html" . }}
<div class="post-title">
<h1>{{ .Title }}</h1>
<h1 {{ with .Params.langs.title }}lang="{{ . }}"{{ end }}>{{ .Title }}</h1>
<div class="post-date"><time>{{ .Date | time.Format "January 2, 2006" }}</time></div>
</div>
</header>
@ -20,33 +17,29 @@
{{ $photos := .Resources.ByType "image" }}
{{ if eq (len $photos) 0 }}
{{ errorf "Missing photo from photos page %q" .Path }}
{{ errorf "Missing photo from photos page %q" .Path }}
{{ end }}
{{ if eq (len $photos) 1 }}
{{ $img := index $photos 0 }}
<figure>
<img src="{{ $img.RelPermalink }}">
</figure>
{{- $img := index $photos 0 -}}
<figure><img src="{{ $img.RelPermalink }}"></figure>
{{ .Content }}
{{ .Content }}
{{ partial "photo_exif_table.html" $img.Exif }}
{{- partial "photo_exif_table.html" $img.Exif -}}
{{ if in ($.Site.BaseURL | string) "localhost" }}
{{ partial "development/photo_exif_table.html" $img.Exif }}
{{ end }}
{{- if in ($.Site.BaseURL | string) "localhost" -}}
{{- partial "development/photo_exif_table.html" $img.Exif -}}
{{- end -}}
{{ else }}
<figure>
<ul class="carousel">
{{ range $photos }}
<li>{{ . }}</li>
{{ end }}
</ul>
</figure>
<figure>
<ul class="carousel">
{{- range $photos -}}
<li>{{ . }}</li>
{{- end -}}
</ul>
</figure>
{{ end }}
</article>
{{ end }}
{{ define "footer" }}