From 32694e101c81693353b00f7caadab37c6329343e Mon Sep 17 00:00:00 2001 From: Will Faught Date: Sun, 5 Feb 2023 10:41:22 -0800 Subject: [PATCH] Use paige.home config for home page --- README.md | 14 ++++++++------ exampleSite/content/_index.md | 15 ++++++++++----- layouts/_default/home.html | 16 ++++++++-------- 3 files changed, 26 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index d15cf3fc..cc90f28f 100644 --- a/README.md +++ b/README.md @@ -368,14 +368,16 @@ paige: hide: false # Default is false ``` -Additional optional home page parameters: +Optional home page parameters: ```yaml -blurb: "There's a new daddy in town." # Displayed below the greeting -greeting: "You know best" # Displayed below the image -image_raw: true # Do not copy or process the image -image_stretch: true # Stretch the image fully horizontally if true; center the image otherwise -image_url: "me.jpg" # A page, site, or remote resource glob +paige: + home: + blurb: "There's a new daddy in town." # Displayed below the greeting + greeting: "You know best" # Displayed below the image + image_raw: true # Do not copy or process the image + image_stretch: true # Stretch the image fully horizontally if true; center the image otherwise + image_url: "me.jpg" # A page, site, or remote resource glob ``` Additional optional list page parameters: diff --git a/exampleSite/content/_index.md b/exampleSite/content/_index.md index 0266cc37..2ddcf17b 100644 --- a/exampleSite/content/_index.md +++ b/exampleSite/content/_index.md @@ -1,11 +1,16 @@ --- -blurb: There's a new daddy in town. A discipline daddy. If I make this comeback, I'll buy you a hundred George Michaels that you can teach to drive! These are my awards, Mother. From Army. The seal is for marksmanship, and the gorilla is for sand racing. We'll have to find something to do so that people can look at you without wanting to kill [themselves](https://bluthipsum.com). description: Go ahead, touch the Cornballer -greeting: You know [best](https://www.youtube.com/watch?v=1WDW8XKEGgU) -image_stretch: true -image_url: stretch.webp paige: - titleclass: display-1 fw-bold text-center + home: + blurb: There's a new daddy in town. A discipline daddy. If I make this comeback, I'll buy you a hundred George Michaels that you can teach to drive! These are my awards, Mother. From Army. The seal is for marksmanship, and the gorilla is for sand racing. We'll have to find something to do so that people can look at you without wanting to kill [themselves](https://bluthipsum.com). + greeting: You know [best](https://www.youtube.com/watch?v=1WDW8XKEGgU) + image_stretch: true + image_url: stretch.webp + page: + reading_time: + hide: true + title: + class: display-1 fw-bold text-center title: No Borders, No Limits --- diff --git a/layouts/_default/home.html b/layouts/_default/home.html index 7ce346d8..20053acd 100644 --- a/layouts/_default/home.html +++ b/layouts/_default/home.html @@ -4,25 +4,25 @@
{{ partial "paige/metadata.html" $page }}
- {{ if $page.Params.image_url }} - {{ $class := cond $page.Params.image_stretch "rounded-4 shadow w-100" "mw-100 rounded-4 shadow" }} - {{ $style := cond $page.Params.image_stretch "height: 20rem; object-fit: cover" "height: 20rem" }} + {{ if $page.Param "paige.home.image_url" }} + {{ $class := cond ($page.Param "paige.home.image_stretch" | not) "mw-100 rounded-4 shadow" "rounded-4 shadow w-100" }} + {{ $style := cond ($page.Param "paige.home.image_stretch" | not) "height: 20rem" "height: 20rem; object-fit: cover" }} -

+

{{ partial "paige/img.html" (dict "class" $class "fetchpriority" "high" "loading" "eager" - "raw" $page.Params.image_raw - "src" $page.Params.image_url + "raw" ($page.Param "paige.home.image_raw") + "src" ($page.Param "paige.home.image_url") "style" $style ) }}

{{ end }} - {{ with $page.Params.greeting }} + {{ with $page.Param "paige.home.greeting" }}

{{ . | markdownify }}

{{ end }} - {{ with $page.Params.blurb }} + {{ with $page.Param "paige.home.blurb" }}