From 08bda9879a539d9434c49d3377dcdc400602b021 Mon Sep 17 00:00:00 2001 From: Haojin Li Date: Thu, 13 Apr 2023 03:57:46 -0400 Subject: [PATCH 1/2] :sparkles:Add dark mode logo option --- config/_default/params.toml | 1 + layouts/partials/logo.html | 25 ++++++++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/config/_default/params.toml b/config/_default/params.toml index bb8bdd54..c9a9788c 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -17,6 +17,7 @@ enableCodeCopy = false [header] layout = "basic" # valid options: basic, hamburger, hybrid, custom # logo = "img/logo.jpg" + # darkLogo = "img/dark-logo.jpg" # specify a different logo for dark mode if needed showTitle = true [footer] diff --git a/layouts/partials/logo.html b/layouts/partials/logo.html index a9cd2a59..de66af69 100644 --- a/layouts/partials/logo.html +++ b/layouts/partials/logo.html @@ -1,6 +1,29 @@ {{- if .Site.Params.header.logo }} {{- $logo := resources.Get .Site.Params.header.logo }} - {{- if $logo }} + {{- $darkLogo := resources.Get .Site.Params.header.darkLogo }} + + + {{- if and $logo $darkLogo }} + + {{ .Site.Title }} + + + + {{- else if $logo }} Date: Thu, 25 May 2023 12:26:06 +1000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9D=20Update=20configuration=20doc?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- exampleSite/content/docs/configuration/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/exampleSite/content/docs/configuration/index.md b/exampleSite/content/docs/configuration/index.md index 52811407..53695baf 100644 --- a/exampleSite/content/docs/configuration/index.md +++ b/exampleSite/content/docs/configuration/index.md @@ -130,6 +130,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.| |`header.layout`|`"basic"`|The layout of the page header and menu. Valid values are `basic`, `hamburger`, `hybrid` or `custom`. When set to `custom`, you must provide your own layout by creating a `/layouts/partials/header/custom.html` file.| |`header.logo`|_Not set_|The relative path to the site logo file within the `assets/` folder. The logo file should be provided at 2x resolution and supports any image dimensions.| +|`header.darkLogo`|_Not set_|As per the `header.logo` parameter, however this image is used whenever dark mode is active.| |`header.showTitle`|`true`|Whether the site title is displayed in the header.| |`footer.showCopyright`|`true`|Whether or not to show the copyright string in the site footer. Note that the string itself can be customised using the `copyright` parameter in the [languages configuration](#language-and-i18n).| |`footer.showThemeAttribution`|`true`|Whether or not to show the "powered by" theme attribution in the site footer. If you choose to disable this message, please consider attributing the theme somewhere else on your site (for example, on your about page).|