From fa8a66170299a51e98201df9e60086284f37cc5b Mon Sep 17 00:00:00 2001 From: Bernhard Kaindl Date: Tue, 18 Jun 2024 16:32:17 +0200 Subject: [PATCH] Hugo docs: Add dark mode support, theme variant selector and print Signed-off-by: Bernhard Kaindl --- .github/workflows/hugo.yml | 2 +- doc/hugo.toml | 26 ++++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.github/workflows/hugo.yml b/.github/workflows/hugo.yml index 0b48e6c8a62..9b831b12ae7 100644 --- a/.github/workflows/hugo.yml +++ b/.github/workflows/hugo.yml @@ -16,7 +16,7 @@ jobs: - name: Setup Hugo uses: peaceiris/actions-hugo@v3 with: - hugo-version: '0.119.0' + hugo-version: '0.127.0' - name: Build run: | diff --git a/doc/hugo.toml b/doc/hugo.toml index bb1127b019e..d7eb93250e4 100644 --- a/doc/hugo.toml +++ b/doc/hugo.toml @@ -9,10 +9,32 @@ assetsDir = "assets" [[module.imports]] path = 'github.com/McShelby/hugo-theme-relearn' +# The latest upstream version of hugo-theme-relearn needs hugo 0.121.0: +# https://mcshelby.github.io/hugo-theme-relearn/basics/requirements/index.html +[module.hugoVersion] + min = "0.121.0" + [outputs] -home = [ "HTML", "RSS", "SEARCH"] +# Home and section pages should also have a print icon for the print view: +home = [ "HTML", "RSS", "SEARCH", "PRINT"] +section = [ "HTML", "RSS", "PRINT"] [params] -themeVariant = "red" +# Enable the theme variant selector, default to auto: +themeVariant = [ + "auto", + "zen-light", + "zen-dark", + "red", + "blue", + "green", + "learn", + "neon", + "relearn-light", + "relearn-bright", + "relearn-dark" +] +# auto switches between "red" and "zen-dark" depending on the browser/OS dark mode: +themeVariantAuto = ["red", "zen-dark"] alwaysopen = false collapsibleMenu = true