From 090fd09ccf82e80cdb475568546a951c3e4a3500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= <40151420+ldericher@users.noreply.github.com> Date: Thu, 8 Aug 2024 01:36:30 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20add=20parameter=20backgroundImageWi?= =?UTF-8?q?dth=20+=20english=20documentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/_default/params.toml | 1 + exampleSite/content/docs/configuration/index.md | 1 + layouts/partials/hero/background.html | 2 +- layouts/partials/hero/basic.html | 2 +- layouts/partials/hero/big.html | 2 +- layouts/partials/hero/thumbAndBackground.html | 4 ++-- 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/config/_default/params.toml b/config/_default/params.toml index fc4edcb2..09a62b7a 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -17,6 +17,7 @@ enableCodeCopy = false disableImageOptimization = false disableTextInHeader = false +# backgroundImageWidth = 1200 # defaultBackgroundImage = "IMAGE.jpg" # used as default for background images # defaultFeaturedImage = "IMAGE.jpg" # used as default for featured images in all articles diff --git a/exampleSite/content/docs/configuration/index.md b/exampleSite/content/docs/configuration/index.md index 7b3ce190..6ccb68a8 100644 --- a/exampleSite/content/docs/configuration/index.md +++ b/exampleSite/content/docs/configuration/index.md @@ -176,6 +176,7 @@ Many of the article defaults here can be overridden on a per article basis by sp | `robots` | _Not set_ | String that indicates how robots should handle your site. If set, it will be output in the page head. Refer to [Google's docs](https://developers.google.com/search/docs/advanced/robots/robots_meta_tag#directives) for valid values. | | `disableImageZoom` | `false` | Disables image zoom feature across all the images in the site. | | `disableImageOptimization` | `false` | Disables image resize and optimization features across all the images in the site. | +| `backgroundImageWidth` | `1200` | Width (in pixels) to scale background images to. | | `disableTextInHeader` | `false` | Disables text in header, useful for logo based headers. | | `defaultBackgroundImage` | _Not set_ | Default background image for both `background` homepage layout and `background` hero style | | `defaultFeaturedImage` | _Not set_ | Default background image for all `featured` images across articles, will be overridden by a local `featured` image. | diff --git a/layouts/partials/hero/background.html b/layouts/partials/hero/background.html index 1f6e3fb3..2cf1d6ea 100644 --- a/layouts/partials/hero/background.html +++ b/layouts/partials/hero/background.html @@ -41,7 +41,7 @@ style="background-image:url({{ .RelPermalink }});"> {{ end }} {{ else }} - {{ with .Resize "1200x" }} + {{ with .Resize (print (default "1200" $.Site.Params.backgroundImageWidth) "x") }}