diff options
author | Dillon <dillonzq@outlook.com> | 2020-05-12 19:45:19 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-12 19:45:19 +0300 |
commit | 762a7e538d291e0ede8ca4d64b2fcf12ec5d8e9c (patch) | |
tree | f06f89d019773095e90e74f06d3bf699d0e9da44 /layouts/_default | |
parent | 6aa05a7f3e4ab75d4c7847d15a4af36375d1c4f0 (diff) |
feat(compatibility): improve compatibility for Hugo basic version (#352)
Diffstat (limited to 'layouts/_default')
-rw-r--r-- | layouts/_default/baseof.html | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index cf923ba..9490a6e 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -27,9 +27,7 @@ {{- end -}} {{- .Scratch.Set "params" $params -}} - -{{- $this := dict "desktop" .Site.Params.header.desktopMode "mobile" .Site.Params.header.mobileMode | dict "headerMode" | dict "config" -}} -{{- .Scratch.Set "this" $this -}} +{{- .Scratch.Set "this" dict -}} <!DOCTYPE html> <html lang="{{ .Site.LanguageCode }}"> @@ -47,7 +45,7 @@ {{- partial "head/link.html" . -}} {{- partial "head/seo.html" . -}} </head> - <body> + <body header-desktop="{{ .Site.Params.header.desktopMode }}" header-mobile="{{ .Site.Params.header.mobileMode }}"> {{- /* Check theme isDark before body rendering */ -}} {{- $theme := .Site.Params.defaulttheme -}} <script type="text/javascript">(window.localStorage && localStorage.getItem('theme') ? localStorage.getItem('theme') === 'dark' : ('{{ $theme }}' === 'auto' ? window.matchMedia('(prefers-color-scheme: dark)').matches : '{{ $theme }}' === 'dark')) && document.body.setAttribute('theme', 'dark');</script> |