From c1a365ec93422bf34896caa18755fd6b1bf060ee Mon Sep 17 00:00:00 2001 From: tdro Date: Wed, 28 Dec 2022 00:54:50 -0500 Subject: themes/default/layouts/_default/home.authors: Mix in dates This could use the page variable directly but it might be useful for passing stacks of variable data --- assets/css/default.css | 8 ++++++-- themes/default/layouts/_default/home.authors.html | 7 ++++++- themes/default/layouts/partials/author-card.html | 19 ++++++++++++++++--- themes/default/layouts/partials/author-list.html | 11 ++++++++--- 4 files changed, 36 insertions(+), 9 deletions(-) diff --git a/assets/css/default.css b/assets/css/default.css index a6e7c43..b4785b5 100644 --- a/assets/css/default.css +++ b/assets/css/default.css @@ -1511,12 +1511,16 @@ web-ring header { } web-ring time, -following-list time { - font-variant: small-caps; +micro-author micro-header time { + display: block; color: #444; color: var(--fade); } +web-ring time { + font-variant: small-caps; +} + web-ring p, web-ring time { display: inline; diff --git a/themes/default/layouts/_default/home.authors.html b/themes/default/layouts/_default/home.authors.html index 6eb6617..8e63d51 100644 --- a/themes/default/layouts/_default/home.authors.html +++ b/themes/default/layouts/_default/home.authors.html @@ -24,7 +24,12 @@ {{- range $author := shuffle $authors -}} {{ $data := index $.Site.Data $author | default "default" }} - {{ partial "author-card.html" (dict "Data" $data) }} + {{- $date := (index (first 1 (where $.Site.Pages.ByDate.Reverse "Section" $author)) 0).Date -}} + {{- partial "author-card.html" (dict + "Data" $data + "Date" $date + ) + -}} {{ end }} {{ end }} diff --git a/themes/default/layouts/partials/author-card.html b/themes/default/layouts/partials/author-card.html index 2897e62..243d360 100644 --- a/themes/default/layouts/partials/author-card.html +++ b/themes/default/layouts/partials/author-card.html @@ -1,4 +1,5 @@ {{- $metadata := print "public/" .Data.user "/author.json" -}} +{{- $date := .Date.Local.Format "3:04 PM Jan 2 2006" -}} {{- $host := (urls.Parse ("" | absURL)).Host -}} @@ -26,6 +27,10 @@ {{- $sourceset = "" -}} {{- end -}} +{{- if not .Date -}} + {{- $date = "Inactive" -}} +{{- end -}} + @@ -37,8 +42,8 @@ {{- end -}} {{ $alternate }} @@ -51,8 +56,16 @@ {{ .Data.name }}

- {{ .Data.user }}@{{ $host }} + + {{ .Data.user }}@{{ $host }} +

+

{{ .Data.description | markdownify | plainify | htmlUnescape | truncate 60 "..." }}

diff --git a/themes/default/layouts/partials/author-list.html b/themes/default/layouts/partials/author-list.html index 37e3222..bd87ad5 100644 --- a/themes/default/layouts/partials/author-list.html +++ b/themes/default/layouts/partials/author-list.html @@ -4,8 +4,13 @@

Authors

-- cgit v1.2.3