From 9e126e0c3a9546974f91fc83edcdaf5310728c2a Mon Sep 17 00:00:00 2001 From: tdro Date: Sat, 30 Dec 2023 16:39:52 -0500 Subject: config: Data mounting nesting Apparently nesting/namespacing works. Dicey code bootstrapping/generation. --- data/authors/canory.yaml | 21 +++++++++++++++++++++ data/authors/default.yaml | 21 +++++++++++++++++++++ data/canory.yaml | 21 --------------------- data/default.yaml | 21 --------------------- themes/default/layouts/_default/home.authors.html | 2 +- .../layouts/_default/home.authors.section.html | 2 +- themes/default/layouts/partials/base-footer.html | 2 +- themes/default/layouts/partials/base-title.html | 2 +- .../layouts/partials/function-authors-data.html | 2 +- .../layouts/partials/function-authors-slice.html | 2 +- .../default/layouts/partials/generate-authors.html | 2 +- 11 files changed, 49 insertions(+), 49 deletions(-) create mode 100644 data/authors/canory.yaml create mode 100644 data/authors/default.yaml delete mode 100644 data/canory.yaml delete mode 100644 data/default.yaml diff --git a/data/authors/canory.yaml b/data/authors/canory.yaml new file mode 100644 index 0000000..0b5ea9e --- /dev/null +++ b/data/authors/canory.yaml @@ -0,0 +1,21 @@ +--- +name: Canory +user: canory +title: Canory's Micro Blog +wordlimit: 50 +place: www +domain: + host: canory.example + url: https://example.com +epoch: Arrived on the second fortnight of April, `2022` +picture: + header: media/header.jpg + profile: media/picture.png +description: > + Descended from an inner star system of the Sunflower galaxy. Not an owl. + Theme Canory --- a micro blog theme for [Hugo](https://gohugo.io/), one of many + [static site generators](https://jamstack.org/generators/). +feeds: + rss: + - https://www.rfc-editor.org/rfcrss.xml + json: diff --git a/data/authors/default.yaml b/data/authors/default.yaml new file mode 100644 index 0000000..eecf346 --- /dev/null +++ b/data/authors/default.yaml @@ -0,0 +1,21 @@ +--- +name: Default +user: default +title: Default's Micro Blog +wordlimit: 50 +place: In your head +domain: + host: default.example + url: https://example.com +picture: + header: media/header.jpg + profile: media/picture.png +epoch: Appeared sometime around April, `2022` +description: > + Dignissimos quis animi velit. Not a bot. If you believe everything you read on + the Internet, you'll think that I'm human. +feeds: + rss: + - https://hacks.mozilla.org/feed/ + - https://bing.com/HPImageArchive.aspx?format=rss&idx=0&n=1&mkt=en-US + json: diff --git a/data/canory.yaml b/data/canory.yaml deleted file mode 100644 index 0b5ea9e..0000000 --- a/data/canory.yaml +++ /dev/null @@ -1,21 +0,0 @@ ---- -name: Canory -user: canory -title: Canory's Micro Blog -wordlimit: 50 -place: www -domain: - host: canory.example - url: https://example.com -epoch: Arrived on the second fortnight of April, `2022` -picture: - header: media/header.jpg - profile: media/picture.png -description: > - Descended from an inner star system of the Sunflower galaxy. Not an owl. - Theme Canory --- a micro blog theme for [Hugo](https://gohugo.io/), one of many - [static site generators](https://jamstack.org/generators/). -feeds: - rss: - - https://www.rfc-editor.org/rfcrss.xml - json: diff --git a/data/default.yaml b/data/default.yaml deleted file mode 100644 index eecf346..0000000 --- a/data/default.yaml +++ /dev/null @@ -1,21 +0,0 @@ ---- -name: Default -user: default -title: Default's Micro Blog -wordlimit: 50 -place: In your head -domain: - host: default.example - url: https://example.com -picture: - header: media/header.jpg - profile: media/picture.png -epoch: Appeared sometime around April, `2022` -description: > - Dignissimos quis animi velit. Not a bot. If you believe everything you read on - the Internet, you'll think that I'm human. -feeds: - rss: - - https://hacks.mozilla.org/feed/ - - https://bing.com/HPImageArchive.aspx?format=rss&idx=0&n=1&mkt=en-US - json: diff --git a/themes/default/layouts/_default/home.authors.html b/themes/default/layouts/_default/home.authors.html index 3854ebe..0662285 100644 --- a/themes/default/layouts/_default/home.authors.html +++ b/themes/default/layouts/_default/home.authors.html @@ -26,7 +26,7 @@ {{- $authors := partial "function-authors-slice.html" . -}} {{- range $author := $authors -}} - {{- $data := index $.Site.Data $author -}} + {{- $data := index $.Site.Data.authors $author -}} {{- $date := (index (first 1 (where $.Site.Pages.ByDate.Reverse "Section" $author)) 0).Date -}} {{- partial "author-card.html" (dict "Data" $data diff --git a/themes/default/layouts/_default/home.authors.section.html b/themes/default/layouts/_default/home.authors.section.html index 20ffdc6..b0b1161 100644 --- a/themes/default/layouts/_default/home.authors.section.html +++ b/themes/default/layouts/_default/home.authors.section.html @@ -9,7 +9,7 @@ {{- if $modified -}} {{- range $author := first 3 $authors -}} - {{- $data := index $.Site.Data $author -}} + {{- $data := index $.Site.Data.authors $author -}} {{- $date := (index (first 1 (where $.Site.Pages.ByDate.Reverse "Section" $author)) 0).Date -}} {{- partial "author-card.html" (dict "Data" $data diff --git a/themes/default/layouts/partials/base-footer.html b/themes/default/layouts/partials/base-footer.html index 3873153..cae0cbf 100644 --- a/themes/default/layouts/partials/base-footer.html +++ b/themes/default/layouts/partials/base-footer.html @@ -1,5 +1,5 @@ {{- $kind := in (slice "home" "taxonomy" "term") .Page.Kind -}} -{{- $author := index .Site.Data .Section -}} +{{- $author := index .Site.Data.authors .Section -}}