First cut at a photos site

This commit is contained in:
Eryn Wells 2022-08-27 09:17:42 -07:00
parent d688cb8203
commit 565fd11718
8 changed files with 208 additions and 1 deletions

View file

@ -0,0 +1,15 @@
<details>
<summary>Debug EXIF Data</summary>
<table class="photo-params debug">
<thead>
<td>Key</td>
<td>Value</td>
</thead>
{{ range $k, $v := .Tags }}
<tr>
<td>{{ $k }}</td>
<td>{{ $v }}</td>
</tr>
{{ end }}
</table>
</details>

View file

@ -8,7 +8,7 @@
{{- if eq .Kind "page" -}}
<meta name="description" content="{{ .Summary }}" />
<meta name="author" content="{{ .Params.Author | default site.Author.name }}">
{{- else -}}
{{ else }}
<meta name="description" content="{{ .Params.description }}">
<meta name="author" content="{{ site.Author.name }}">
{{- end -}}

View file

@ -0,0 +1,27 @@
<table class="photo-params">
<thead>
<td class="make-model" colspan=4>{{ .Tags.Make }} {{ .Tags.Model }}</td>
</thead>
<tr>
<td colspan="2" class="location">
{{ $lat := float .Lat }}{{ $latDir := cond (eq $lat 0) "" (cond (gt $lat 0) "N" "S") }}
<data class="latitude" value="{{ $lat }}">{{ .Lat | lang.FormatNumber (cond (ne $lat 0) 3 0) }}º{{ $latDir }}</data>,
{{ $long := float .Long }}{{ $longDir := cond (eq $long 0) "" (cond (gt $long 0) "E" "W") }}
<data class="longitude" value="{{ $long }}">{{ .Long | lang.FormatNumber (cond (ne $long 0) 3 0) }}º{{ $longDir }}</data>
</td>
<td colspan="2" class="size">
{{ $widthpx := .Tags.PixelXDimension }}
{{ $heightpx := .Tags.PixelYDimension }}
{{ if and (gt $widthpx 0) (gt $heightpx 0) }}
{{ $megapixels := div (mul $widthpx $heightpx) 1e6 }}
<data value="{{ $megapixels }}">{{ $megapixels | lang.FormatNumber 0 }} MP</data> • {{ $widthpx }} × {{ $heightpx }}
{{ end }}
</td>
</tr>
<tr class="exposure-attributes">
<td class="iso">{{ with .Tags.ISOSpeedRatings }}ISO {{ . }}{{ end }}</td>
<td class="focal-length">{{ with .Tags.FocalLengthIn35mmFilm }}{{ . }} mm{{ end }}</td>
<td class="f-number">{{ with .Tags.FNumber }}ƒ{{ . }}{{ end }}</td>
<td class="exposure-time">{{ with .Tags.ExposureTime }}{{ . }} s{{ end }}</td>
</tr>
</table>