diff --git a/layouts/observations/list.html b/layouts/observations/list.html new file mode 100644 index 0000000..1ad40d9 --- /dev/null +++ b/layouts/observations/list.html @@ -0,0 +1,24 @@ +{{ define "main"}} + {{ partial "header.html" . }} +
+ + {{ .Content }} + {{ $listPageDateFormat := .Site.Params.listPageDateFormat | default "January, 2006"}} + {{ range $index, $value := .Pages.GroupByDate $listPageDateFormat }} + {{ range .Pages }} + {{ $dataJ := dict "created_at" .Date + "url" .Params.syndication + "quality_grade" .Params.quality_grade + "place_guess" .Params.place_guess + "photos" .Params.photos + "taxon" .Params.taxon + }} + + {{ .Scratch.Set "obs" $dataJ }} + {{ .Scratch.Set "obs_url" .Permalink }} + {{ partial "inat.html" . }} + {{ end }} + {{ end }} +
+ {{ partial "footer.html" . }} +{{ end }} diff --git a/layouts/observations/single.html b/layouts/observations/single.html new file mode 100644 index 0000000..7556023 --- /dev/null +++ b/layouts/observations/single.html @@ -0,0 +1,42 @@ +{{ define "main"}} +{{ .Scratch.Set "customTitleHeaderSet" true }} +{{ .Scratch.Set "customTitleHeader" "Observations" }} +{{ .Scratch.Set "customTitleHeaderLink" "/observations" }} +{{ partial "header.html" . }} +
+ {{ with .Params }} + +
+ {{ $name := "" }} + {{ if (ne .taxon.common_name "") }} + {{ $name = .taxon.common_name }} + {{ else }} + {{ $name = .taxon.name }} + {{ end }} + {{ $obsURL := .url }} +

{{ title $name }}

+ {{ if (eq .quality_grade "research")}} + Research Grade +
+ {{ end }} +

Observed on

+

Location: {{ .place_guess }}

+ Also on: iNaturalist + +
+ {{ if gt (len .photos) 0 }} + {{ range .photos}} + {{ $medium_url := replace .url "square" "medium"}} + {{ $original_url := replace .url "square" "original"}} + Photo of {{ .species_guess }} + {{ end }} + {{ end }} +
+ +
+ {{ end }} +
+ + +{{ partial "footer.html" . }} +{{ end }} diff --git a/layouts/partials/inat.html b/layouts/partials/inat.html new file mode 100644 index 0000000..f1adcce --- /dev/null +++ b/layouts/partials/inat.html @@ -0,0 +1,41 @@ +{{ $obsData := .Scratch.Get "obs" }} +{{ $scratchURL := .Scratch.Get "obs_url" }} + +{{ with $obsData }} + +
+ {{ $name := "" }} + {{ if (ne .taxon.common_name "") }} + {{ $name = .taxon.common_name }} + {{ else }} + {{ $name = .taxon.name }} + {{ end }} + {{ $obsURL := .url }} + {{ with $scratchURL }} + {{ $obsURL = . }} + {{ end }} +

{{ title $name }}

+ {{ if (eq .quality_grade "research")}} + Research Grade +
+ {{ end }} +

Observed on

+
+ +

Location: {{ .place_guess }}

+ + + {{ if gt (len .photos) 0 }} +
+ {{ range .photos}} + {{ $small_url := replace .url "square" "small"}} + {{ $original_url := replace .url "square" "original"}} + Photo of {{ .species_guess }} + {{ end }} +
+ {{ end }} +
+ + | Also on: iNaturalist +
+ {{ end }}