From c9456f53ca21b56b80bc37240049d0d20f9ba6e4 Mon Sep 17 00:00:00 2001 From: Brandon Rozek Date: Sat, 4 May 2024 22:56:42 -0400 Subject: [PATCH] Added user-dependent home page --- layouts/index.html | 96 ++++++++++++++++++++++++++++++++++++++++++++++ themes/pulp | 2 +- 2 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 layouts/index.html diff --git a/layouts/index.html b/layouts/index.html new file mode 100644 index 0000000..eff5ccc --- /dev/null +++ b/layouts/index.html @@ -0,0 +1,96 @@ + + + {{- partial "head.html" . -}} + +
+
+ +
+ {{ $profile_image := resources.Get (printf "img/%s" .Site.Params.avatar) }} + {{ $profile_width := 250 }} + {{ $profile_image := $profile_image.Resize (printf "%dx webp q75" $profile_width) }} + Photo of {{ .Site.Params.Author }} + +
+ +

{{ .Site.Params.Author }}

+ + +

+ {{ .Site.Params.description | safeHTML }} +

+ + + +

You can also find me on:

+ +
+
+ +

Latest Updates

+ + {{ $items := (where site.RegularPages "Type" "blog").ByDate }} + {{ range last 1 $items }} +

Blog Post: {{ .Title }}

+ {{ end }} + + {{ $items := (where site.RegularPages "Type" "paper").ByDate }} + {{ range last 1 $items }} +

Publication: {{ .Title }}

+ {{ end }} + + {{ $items := (where site.RegularPages "Type" "tracks").ByDate }} + {{ range last 1 $items }} +

Recorded Walk: {{ .Title }}

+ {{ end }} + + {{ $data := getJSON "https://en.wikipedia.org/w/api.php?action=query&format=json&list=usercontribs&ucuser=BrandonRozek&uclimit=1" }} + {{ range first 1 $data.query.usercontribs }} +

Last Wikipedia Edit: {{ .title }}

+ {{ end }} + + + {{ $items := (where site.RegularPages "Type" "observations").ByDate }} + {{ range last 1 $items }} + {{ $name := "" }} + {{ if (ne .Params.taxon.common_name "") }} + {{ $name = .Params.taxon.common_name }} + {{ else }} + {{ $name = .Params.taxon.name }} + {{ end }} +

Nature Observation: {{ title $name }}

+ {{ end }} + + + {{ $items := (where site.RegularPages "Type" "menu").ByDate }} + {{ range last 1 $items }} +

Recipe: {{ .Title }}

+ {{ end }} + + + + +
+
+ {{ partial "footer.html" . -}} + + + diff --git a/themes/pulp b/themes/pulp index d689db9..824a45b 160000 --- a/themes/pulp +++ b/themes/pulp @@ -1 +1 @@ -Subproject commit d689db91c27238688c289b091783a65c8445d597 +Subproject commit 824a45b711f7903938213486af5c121ede649b99