diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 6ac29d1edb..b6be433e1b 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -36,7 +36,7 @@ title = "Hugo Relearn Documentation" disableLandingPageButton = true disableMermaid = false titleSeparator = "::" - themeVariant = "relearn-light" + themeVariant = [ "relearn-light", "relearn-dark", "learn", "blue", "green", "red" ] disableSeoHiddenPages = true [outputs] diff --git a/exampleSite/content/basics/configuration/_index.en.md b/exampleSite/content/basics/configuration/_index.en.md index a76c619af3..2a0a355fc1 100644 --- a/exampleSite/content/basics/configuration/_index.en.md +++ b/exampleSite/content/basics/configuration/_index.en.md @@ -60,7 +60,7 @@ Note that some of these parameters are explained in details in other sections of # Order sections in menu by "weight" or "title". Default to "weight"; # this can be overridden in the pages frontmatter ordersectionsby = "weight" - # Change default color scheme with a variant one. Can be "red", "blue", "green". + # Change default color scheme with a variant one. Can be "red", "blue", "green" or an array like [ "blue", "green" ]. themeVariant = "" # Provide a list of custom css files to load relative from the `static/` folder in the site root. custom_css = ["css/foo.css", "css/bar.css"] diff --git a/exampleSite/content/basics/customization/_index.en.md b/exampleSite/content/basics/customization/_index.en.md index e148e86306..71f1e7b13c 100644 --- a/exampleSite/content/basics/customization/_index.en.md +++ b/exampleSite/content/basics/customization/_index.en.md @@ -53,7 +53,7 @@ The Relearn theme let you choose between some predefined color scheme variants, ```toml [params] - # Change default color scheme with a variant one. Can be empty, "red", "blue", "green". + # Change default color scheme with a variant one. Can be empty, "red", "blue", "green" or an array like [ "blue", "green" ]. themeVariant = "" ``` @@ -63,7 +63,7 @@ The Relearn theme let you choose between some predefined color scheme variants, ```toml [params] - # Change default color scheme with a variant one. Can be empty, "red", "blue", "green". + # Change default color scheme with a variant one. Can be empty, "red", "blue", "green" or an array like [ "blue", "green" ]. themeVariant = "red" ``` @@ -73,7 +73,7 @@ The Relearn theme let you choose between some predefined color scheme variants, ```toml [params] - # Change default color scheme with a variant one. Can be empty, "red", "blue", "green". + # Change default color scheme with a variant one. Can be empty, "red", "blue", "green" or an array like [ "blue", "green" ]. themeVariant = "blue" ``` @@ -83,7 +83,7 @@ The Relearn theme let you choose between some predefined color scheme variants, ```toml [params] - # Change default color scheme with a variant one. Can be empty, "red", "blue", "green". + # Change default color scheme with a variant one. Can be empty, "red", "blue", "green" or an array like [ "blue", "green" ]. themeVariant = "green" ``` @@ -137,6 +137,17 @@ Then, set the `themeVariant` value with the name of your custom theme file. That ```toml [params] - # Change default color scheme with a variant one. Can be "red", "blue", "green". + # Change default color scheme with a variant one. Can be "red", "blue", "green" or an array like [ "blue", "green" ]. themeVariant = "mine" ``` + +### Multiple variants + +You can also set multiple variants. In this case, the first variant is the default choosen on first view and a theme selector will be shown in the menu footer. + +```toml +[params] + # Change default color scheme with a variant one. Can be empty, "red", "blue", "green" or an array like [ "blue", "green" ]. + themeVariant = [ "red", "blue ] +``` + diff --git a/exampleSite/content/basics/migration/_index.en.md b/exampleSite/content/basics/migration/_index.en.md index e9f11b131d..2f533cd236 100644 --- a/exampleSite/content/basics/migration/_index.en.md +++ b/exampleSite/content/basics/migration/_index.en.md @@ -20,6 +20,8 @@ This document shows you what's new in the latest release. For a detailed list of This change was made to allow your own menu footer to be placed right after the so called prefooter that comes with the theme (containing the language switch and *Clear history* functionality). +- **New**: You can also set multiple variants. In this case, the first variant is the default choosen on first view and a theme selector will be shown in the menu footer. See the [documentation]({{%relref "basics/customization/#multiple-variants" %}}) for configuration. + ## 2.9.0 - **Breaking**: This release removes the themes implementation of `ref`/`relref` in favor for Hugos standard implementation. This is because of inconsistencies with the themes implementation. In advantage, your project becomes standard complient and exchanging this theme in your project to some other theme will be effortless. diff --git a/layouts/404.html b/layouts/404.html index 4b8d5287b8..8016df95f3 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -23,7 +23,7 @@ {{- partial "custom-header.html" . }} -
+
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index b9aff3c423..3dcfeb6c33 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -8,10 +8,10 @@ {{- $showPrevNext := (and (not .Params.disableNextPrev) (not .Site.Params.disableNextPrev)) }} {{- if $showPrevNext }} {{- with ($.Scratch.Get "relearnPrevPage") }} - + {{- end}} {{- with ($.Scratch.Get "relearnNextPage") }} - + {{- end }} {{- end }}
diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 1c7e8e9107..16ffdc88fb 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -26,7 +26,7 @@ {{- partial "menu.html" . }} -
+
{{- if not .IsHome }} diff --git a/layouts/partials/menu.html b/layouts/partials/menu.html index 4cb820855c..0943c4c760 100644 --- a/layouts/partials/menu.html +++ b/layouts/partials/menu.html @@ -6,7 +6,7 @@ var root_url="/"; var baseUri=root_url.replace(/\/$/, ''); -