erynwells.me/layouts/photos/single.html

48 lines
1.1 KiB
HTML
Raw Normal View History

2022-10-19 07:38:26 -07:00
{{ define "header" }}
{{ partial "header.html" . }}
{{ end }}
2022-08-27 09:17:42 -07:00
{{ define "main" }}
2022-10-21 11:09:30 -07:00
<nav><a class="back" href="{{ ref . `photos` }}">Back</a></nav>
2022-08-27 09:17:42 -07:00
{{ if .Title }}
2022-10-19 07:38:26 -07:00
<header>
{{ partial "development/draft_tag.html" . }}
<div class="post-title">
2022-10-21 11:09:30 -07:00
<h1 {{ with .Params.langs.title }}lang="{{ . }}"{{ end }}>{{ .Title }}</h1>
2022-10-19 07:38:26 -07:00
<div class="post-date"><time>{{ .Date | time.Format "January 2, 2006" }}</time></div>
</div>
</header>
2022-08-27 09:17:42 -07:00
{{ end }}
{{ $photos := .Resources.ByType "image" }}
{{ if eq (len $photos) 0 }}
2022-10-21 11:09:30 -07:00
{{ errorf "Missing photo from photos page %q" .Path }}
2022-08-27 09:17:42 -07:00
{{ end }}
{{ if eq (len $photos) 1 }}
2022-10-21 11:09:30 -07:00
{{- $img := index $photos 0 -}}
<figure><img src="{{ $img.RelPermalink }}"></figure>
2022-08-27 09:17:42 -07:00
2022-10-21 11:09:30 -07:00
{{ .Content }}
2022-08-27 09:17:42 -07:00
2022-10-21 11:09:30 -07:00
{{- partial "photo_exif_table.html" $img.Exif -}}
2022-08-27 09:17:42 -07:00
2022-10-21 11:09:30 -07:00
{{- if in ($.Site.BaseURL | string) "localhost" -}}
{{- partial "development/photo_exif_table.html" $img.Exif -}}
{{- end -}}
2022-08-27 09:17:42 -07:00
{{ else }}
2022-10-21 11:09:30 -07:00
<figure>
<ul class="carousel">
{{- range $photos -}}
<li>{{ . }}</li>
{{- end -}}
</ul>
</figure>
2022-08-27 09:17:42 -07:00
{{ end }}
{{ end }}
2022-10-19 07:38:26 -07:00
{{ define "footer" }}
{{ partial "footer.html" . }}
{{ end }}