Skip to content

Commit

Permalink
Override this behavior and force DarkMode (#44)
Browse files Browse the repository at this point in the history
* feature: override this behavior and enforceDarkMode

* added enforceDarkMode as params on exampleSite/config.toml

Co-authored-by: Weru <16350351+onweru@users.noreply.github.com>
  • Loading branch information
anibal-aguila and onweru authored Jan 5, 2023
1 parent fdc97fb commit 84e1d5c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ paginate = 6
# twitter = "" # twitter handle e.g @weru
# mainSections = ["blog", "docs"] see https://gohugo.io/functions/where/#mainsections
# uncomment the line below will disable darkmode by default.
# disableDarkMode = true # note that the UI control for toggling darkmode will remain in place. This way, the user can decide which mode they would like to use while browsing your website
# uncomment and set value below to either "light" or "dark" to make default mode dark.
# defaultMode = "" # Note that the UI control for toggling darkmode will remain in place. This way, the user can decide which mode they would like to use while browsing your website
logo = "" # if the value is an empty string, the site title will be shown instead
faviconsDir = "images/icons/" # with a trailing slash
faviconsDir = "images/icons/" # with a trailing slash
2 changes: 1 addition & 1 deletion layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE html>
{{- $params := .Site.Params }}
<html lang="{{ .Lang }}" {{ if $params.disableDarkMode }}class="nodarkmode"{{ end }}>
<html lang="{{ .Lang }}" {{ if $params.disableDarkMode }} class="nodarkmode"{{ end }}{{ with $params.enforceDarkMode }} data-mode="dim"{{ end }}>
{{ partial "head" . }}
<body>
{{ partialCached "nav" . }}
Expand Down

0 comments on commit 84e1d5c

Please sign in to comment.