www.eamoncaddigan.net

Content and configuration for https://www.eamoncaddigan.net
git clone https://git.eamoncaddigan.net/www.eamoncaddigan.net.git
Log | Files | Refs | Submodules | README

commit 1cf71f032c794808d5a4d6bc5fcd7dd8024074dd
parent 7a7c31cebfe82934cf144f978a8afbf3ffd7b9df
Author: Eamon Caddigan <eamon.caddigan@gmail.com>
Date:   Sat, 18 May 2024 19:50:38 -0700

Add a "now page" that will disappear when out-of-date

In addition to writing the now page itself, I created a new layout for
my Hugo template and a new partial footer. When the page is older than
~1/2 of a year (using a value defined as a site parameter), it won't be
listed in the footer, and the page contents will be replaced by a
placeholder.

Diffstat:
Mconfig/_default/params.yml | 1+
Acontent/now/index.md | 23+++++++++++++++++++++++
Alayouts/page/now.html | 12++++++++++++
Mlayouts/partials/footer.html | 12++++++++++--
4 files changed, 46 insertions(+), 2 deletions(-)

diff --git a/config/_default/params.yml b/config/_default/params.yml @@ -2,3 +2,4 @@ author: 'Eamon Caddigan' mastodon: 'https://social.coop/@eamon' subtitle: 'Writing boring posts is okay' navbar_style: classy +now_timeout: 15778800 diff --git a/content/now/index.md b/content/now/index.md @@ -0,0 +1,23 @@ +--- +title: "Now" +layout: now +date: 2024-05-18T20:42:19-07:00 +alternate: This page is out of date! +--- + +We’ve been in our new home in Southern California for nearly a year and +a half. I still have a long list of projects to do around the house (which +seems to keep growing no matter how much I finish), but I think I can say +that we’re “settled in”. My youngest child loves preschool, and my spouse is +thriving in her new role. My oldest child is on the east coast and has +nearly finished her first year of post-collegiate professional life. I’m +still stitching together a social life, but having moved across the country +before, I understand that this is a years-long---maybe +a lifetime-long---process. + +Professionally, I started a new position last autumn in the public sector. +I’m happy with my new job responsibilities, the team I get to work with, and +the organization’s mission. This role pushes me more in the direction of +a [Type B data +scientist](https://www.quora.com/What-is-data-science/answer/Michael-Hochster), +but I think I was ready for a slight change of focus. diff --git a/layouts/page/now.html b/layouts/page/now.html @@ -0,0 +1,12 @@ +{{ define "main" }} +<h1>{{ .Title }}</h1> +{{ partial "metadata.html" . }} +<!-- <br><br> --> +<article> +{{ if ge .Lastmod.Unix (sub time.Now.Unix .Site.Params.now_timeout) }} +{{ .Content }} +{{ else }} +<p>{{ .Param "alternate" }}</p> +{{ end }} +</article> +{{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html @@ -1,2 +1,10 @@ -<p>© {{ .Lastmod.Format "2006" }} {{ $.Site.Params.author }}, <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></p> -<p><a rel="me" href="{{ $.Site.Params.Mastodon }}" target="blank">Mastodon</a> | <a href="/about/">About</a> | <a href="/posts/index.xml">RSS Feed</a></p> +<p>&copy; {{ .Lastmod.Format "2006" }} {{ .Site.Params.author }}, <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a></p> +<p> + <a rel="me" href="{{ .Site.Params.Mastodon }}" target="blank">Mastodon</a> | + <a href="/about/">About</a> | + {{ $now := .GetPage "/now/" }} + {{ if ge $now.Lastmod.Unix (sub time.Now.Unix .Site.Params.now_timeout) }} + <a href="{{ $now.RelPermalink }}">{{ $now.Title }}</a> | + {{ end }} + <a href="/posts/index.xml">RSS Feed</a> +</p>