diff --git a/config.toml b/config.toml index 1e979d1..8ce7054 100644 --- a/config.toml +++ b/config.toml @@ -90,6 +90,8 @@ sidebar_menu_compact = true sidebar_menu_foldable = true # Set to true to hide the sidebar search box (the top nav search box will still be displayed if search is enabled) sidebar_search_disable = false +# Enables dark mode toggle in Navigation Menu +showLightDarkModeMenu = true # Adds a H2 section titled "Feedback" to the bottom of each doc. The responses are sent to Google Analytics as events. # This feature depends on [services.googleAnalytics] and will be disabled if "services.googleAnalytics.id" is not set. diff --git a/layouts/partials/navbar.html b/layouts/partials/navbar.html index e015240..62fde2f 100644 --- a/layouts/partials/navbar.html +++ b/layouts/partials/navbar.html @@ -30,6 +30,11 @@ {{ partial "navbar-lang-selector.html" . }} {{ end }} + {{ if .Site.Params.ui.showLightDarkModeMenu -}} + + {{ end -}}
diff --git a/layouts/partials/theme-toggler.html b/layouts/partials/theme-toggler.html new file mode 100644 index 0000000..675ea2f --- /dev/null +++ b/layouts/partials/theme-toggler.html @@ -0,0 +1,59 @@ +{{/* Adapted from: https://github.com/twbs/bootstrap/blob/main/site/layouts/partials/icons.html */ -}} + + + + + + + + + + + + + + + + + +{{/* Adapted from: https://github.com/twbs/bootstrap/blob/main/site/layouts/partials/theme-toggler.html */ -}} + +{{ $isExamples := eq .Layout "examples" -}} + + \ No newline at end of file