From cce3a8d97c895505feedb0941c505e38a5eed070 Mon Sep 17 00:00:00 2001 From: Will Faught Date: Sun, 5 Feb 2023 10:46:55 -0800 Subject: [PATCH] Combine paige.home.image_* params under paige.home.image --- README.md | 14 ++++++++------ exampleSite/content/_index.md | 5 +++-- layouts/_default/home.html | 12 ++++++------ 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index cc90f28f..5827f82c 100644 --- a/README.md +++ b/README.md @@ -248,9 +248,10 @@ 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 + image: + raw: true # Do not copy or process the image + stretch: true # Stretch the image fully horizontally if true; center the image otherwise + url: "me.jpg" # A page, site, or remote resource glob hide_credit_data: true # Don't credit this project in a data attribute hide_credit_link: true # Don't credit this project in the footer list: @@ -375,9 +376,10 @@ 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 + image: + raw: true # Do not copy or process the image + stretch: true # Stretch the image fully horizontally if true; center the image otherwise + 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 2ddcf17b..4207177f 100644 --- a/exampleSite/content/_index.md +++ b/exampleSite/content/_index.md @@ -4,8 +4,9 @@ paige: 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 + image: + stretch: true + url: stretch.webp page: reading_time: hide: true diff --git a/layouts/_default/home.html b/layouts/_default/home.html index 20053acd..9272229a 100644 --- a/layouts/_default/home.html +++ b/layouts/_default/home.html @@ -4,17 +4,17 @@
{{ partial "paige/metadata.html" $page }}
- {{ 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" }} + {{ 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.Param "paige.home.image_raw") - "src" ($page.Param "paige.home.image_url") + "raw" ($page.Param "paige.home.image.raw") + "src" ($page.Param "paige.home.image.url") "style" $style ) }}