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" }} {{ define "main" }}
{{- $pages := (.Paginate (first 50 (.Pages.GroupByDate "January 2006"))).PageGroups -}} {{- $pages := (.Paginate (first 50 (.Pages.GroupByDate "January 2006"))).PageGroups -}}
{{- range $pages -}} {{- range $pages -}}
<section class="photos">
<h6>{{ .Key | title }}</h6> <h6>{{ .Key | title }}</h6>
<ul class="grid"> <ul class="grid">
{{- range .Pages -}} {{- range .Pages -}}
{{- .Render "li_thumbnail_in_grid" -}} {{- .Render "li_thumbnail_in_grid" -}}
{{- end -}} {{- end -}}
</ul> </ul>
</section>
{{- end -}} {{- end -}}
{{ end }} {{ end }}

View file

@ -3,16 +3,13 @@
{{ end }} {{ end }}
{{ define "main" }} {{ define "main" }}
<article class="post-single"> <nav><a class="back" href="{{ ref . `photos` }}">Back</a></nav>
<nav class="post-nav">
<a class="back" href="{{ ref . `photos` }}">Back</a>
</nav>
{{ if .Title }} {{ if .Title }}
<header> <header>
{{ partial "development/draft_tag.html" . }} {{ partial "development/draft_tag.html" . }}
<div class="post-title"> <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 class="post-date"><time>{{ .Date | time.Format "January 2, 2006" }}</time></div>
</div> </div>
</header> </header>
@ -24,29 +21,25 @@
{{ end }} {{ end }}
{{ if eq (len $photos) 1 }} {{ if eq (len $photos) 1 }}
{{ $img := index $photos 0 }} {{- $img := index $photos 0 -}}
<figure> <figure><img src="{{ $img.RelPermalink }}"></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" }} {{- if in ($.Site.BaseURL | string) "localhost" -}}
{{ partial "development/photo_exif_table.html" $img.Exif }} {{- partial "development/photo_exif_table.html" $img.Exif -}}
{{ end }} {{- end -}}
{{ else }} {{ else }}
<figure> <figure>
<ul class="carousel"> <ul class="carousel">
{{ range $photos }} {{- range $photos -}}
<li>{{ . }}</li> <li>{{ . }}</li>
{{ end }} {{- end -}}
</ul> </ul>
</figure> </figure>
{{ end }} {{ end }}
</article>
{{ end }} {{ end }}
{{ define "footer" }} {{ define "footer" }}