mirror of
https://github.com/Brandon-Rozek/website-theme.git
synced 2025-07-31 14:12:01 +00:00
Removed observation layout, and modified inaturalist embed
This commit is contained in:
parent
bcbfa17bb4
commit
831dd9e10a
3 changed files with 1 additions and 79 deletions
|
@ -1,39 +0,0 @@
|
||||||
{{ define "main"}}
|
|
||||||
{{ partial "header.html" . }}
|
|
||||||
<main>
|
|
||||||
<style>main { text-align: left; }</style>
|
|
||||||
{{ $posts := where site.RegularPages "Type" "observations" }}
|
|
||||||
{{ $postCount := len $posts }}
|
|
||||||
{{ range last 1 $posts }}
|
|
||||||
{{ $scratch := newScratch }}
|
|
||||||
{{ $scratch.Set "researchGradeCount" 0 }}
|
|
||||||
{{ range .Pages }}
|
|
||||||
{{ if (eq .quality_grade "research")}}
|
|
||||||
{{ $scratch.Add "researchGradeCount" 1 }}
|
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
|
||||||
{{ $tags := .Site.Taxonomies.tags }}
|
|
||||||
<div style="text-align: center; margin-bottom: 2rem;" class='bloglist-teaser block-center'>
|
|
||||||
Hello! This page contains {{ $postCount | lang.FormatNumber 0 }} observations,
|
|
||||||
{{ len $tags }} of which are <strong><a href="https://www.inaturalist.org/posts/39072-research-grade">research grade</a></strong>.
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
|
||||||
{{ .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 "external/inat.html" . }}
|
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
|
||||||
</main>
|
|
||||||
{{ end }}
|
|
|
@ -1,39 +0,0 @@
|
||||||
{{ define "main"}}
|
|
||||||
{{ .Scratch.Set "customTitleHeaderSet" true }}
|
|
||||||
{{ .Scratch.Set "customTitleHeader" "Observations" }}
|
|
||||||
{{ .Scratch.Set "customTitleHeaderLink" "/observations/" }}
|
|
||||||
{{ partial "header.html" . }}
|
|
||||||
<main>
|
|
||||||
{{ with .Params }}
|
|
||||||
|
|
||||||
<article class="h-entry">
|
|
||||||
{{ $name := "" }}
|
|
||||||
{{ if (ne .taxon.common_name "") }}
|
|
||||||
{{ $name = .taxon.common_name }}
|
|
||||||
{{ else }}
|
|
||||||
{{ $name = .taxon.name }}
|
|
||||||
{{ end }}
|
|
||||||
{{ $obsURL := .url }}
|
|
||||||
<h1 class='title p-name'>{{ title $name }}</h1>
|
|
||||||
{{ if (eq .quality_grade "research")}}
|
|
||||||
<span>Research Grade </span><i class="fa fa-solid fa-clipboard-check"></i></i>
|
|
||||||
<br/>
|
|
||||||
{{ end }}
|
|
||||||
<p class="date">Observed on <time class="dt-published" datetime='{{ .date }}'>{{ dateFormat "January 2, 2006 15:04" (time .date) }}</time></p>
|
|
||||||
<p>Location: {{ .place_guess }}</p>
|
|
||||||
<span>Also on: <a class="u-syndication" href="{{ .syndication }}">iNaturalist</a></span>
|
|
||||||
|
|
||||||
<div class="e-content">
|
|
||||||
{{ if gt (len .photos) 0 }}
|
|
||||||
{{ range .photos}}
|
|
||||||
{{ $medium_url := replace .url "square" "medium"}}
|
|
||||||
{{ $original_url := replace .url "square" "original"}}
|
|
||||||
<a href="{{ $original_url }}"><img src="{{ $medium_url }}" alt="Photo of {{ .species_guess }}"/></a>
|
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
|
||||||
</div>
|
|
||||||
<a class="u-url" style="display: none">{{ .Permalink }}</a>
|
|
||||||
</article>
|
|
||||||
{{ end }}
|
|
||||||
</main>
|
|
||||||
{{ end }}
|
|
2
layouts/partials/external/inat.html
vendored
2
layouts/partials/external/inat.html
vendored
|
@ -6,7 +6,7 @@
|
||||||
<article class="toot h-entry">
|
<article class="toot h-entry">
|
||||||
{{ $name := "" }}
|
{{ $name := "" }}
|
||||||
{{ if (ne .taxon.common_name "") }}
|
{{ if (ne .taxon.common_name "") }}
|
||||||
{{ $name = .taxon.common_name }}
|
{{ $name = .taxon.preferred_common_name }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ $name = .taxon.name }}
|
{{ $name = .taxon.name }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
Loading…
Add table
Reference in a new issue