Bläddra i källkod

feat: more intuitive settings

BREAKING CHANGES: in params.yaml:

```
appearance:
  theme_day: minimal
  theme_night: minimal
  font: minimal
  font_size: L

seo:
  site_type: Person
  local_business_type: ''
  org_name: ''
  description: ''
  twitter: ''

header:
  navbar:
    enable: false

footer:
  text:
  copyright:
    notice: '© {year} Me. This work is licensed under {license}'
    license:
      enable: true
      allow_derivatives: false
      share_alike: true
      allow_commercial: false

features:
  privacy_pack: false
```
George Cushen 3 år sedan
förälder
incheckning
439dfb3a40
30 ändrade filer med 273 tillägg och 262 borttagningar
  1. 0 1
      starters/markdown-slides/config/_default/config.yaml
  2. 28 18
      starters/markdown-slides/config/_default/params.yaml
  3. 3 3
      starters/markdown-slides/content/slides/example/index.md
  4. 1 0
      wowchemy/assets/scss/main.scss
  5. 7 0
      wowchemy/assets/scss/wowchemy/elements/_content.scss
  6. 12 16
      wowchemy/data/themes/1950s.toml
  7. 11 13
      wowchemy/data/themes/apogee.toml
  8. 12 16
      wowchemy/data/themes/coffee.toml
  9. 11 10
      wowchemy/data/themes/cyberpunk.toml
  10. 11 13
      wowchemy/data/themes/dark.toml
  11. 15 19
      wowchemy/data/themes/earth.toml
  12. 11 13
      wowchemy/data/themes/forest.toml
  13. 14 13
      wowchemy/data/themes/minimal.toml
  14. 11 13
      wowchemy/data/themes/mr_robot.toml
  15. 11 13
      wowchemy/data/themes/ocean.toml
  16. 11 13
      wowchemy/data/themes/rose.toml
  17. 11 13
      wowchemy/data/themes/strawberry.toml
  18. 3 3
      wowchemy/layouts/_default/baseof.html
  19. 1 1
      wowchemy/layouts/partials/cookie_consent.html
  20. 1 1
      wowchemy/layouts/partials/functions/get_author_name.html
  21. 51 42
      wowchemy/layouts/partials/functions/parse_theme.html
  22. 1 1
      wowchemy/layouts/partials/jsonld/article.html
  23. 3 3
      wowchemy/layouts/partials/jsonld/business.html
  24. 1 1
      wowchemy/layouts/partials/jsonld/main.html
  25. 1 1
      wowchemy/layouts/partials/marketing/google_analytics.html
  26. 10 9
      wowchemy/layouts/partials/navbar.html
  27. 1 1
      wowchemy/layouts/partials/page_author_card.html
  28. 2 2
      wowchemy/layouts/partials/site_footer.html
  29. 15 7
      wowchemy/layouts/partials/site_footer_license.html
  30. 3 3
      wowchemy/layouts/partials/site_head.html

+ 0 - 1
starters/markdown-slides/config/_default/config.yaml

@@ -5,7 +5,6 @@
 
 title: Markdown Slides # Website name
 baseurl: 'https://example.com/' # Website URL
-copyright: '' # Footer text, e.g. '© {year} Me'
 
 ############################
 ## LANGUAGE

+ 28 - 18
starters/markdown-slides/config/_default/params.yaml

@@ -5,23 +5,37 @@
 
 # Appearance
 
-theme: minimal
-day_night: true
-font: ''
-font_size: L
+appearance:
+  theme_day:
+  theme_night:
+  font:
+  font_size: L
 
 # SEO
 
-site_type: Person
-local_business_type: ''
-org_name: ''
-description: ''
-twitter: ''
+seo:
+  site_type: Person
+  local_business_type: ''
+  org_name: ''
+  description: ''
+  twitter: ''
 
 # Site header
 
-main_menu:
-  enable: false
+header:
+  navbar:
+    enable: false
+
+# Site footer
+
+footer:
+  copyright:
+    notice: '© {year} Me. This work is licensed under {license}'
+    license:
+      enable: true
+      allow_derivatives: false
+      share_alike: true
+      allow_commercial: false
 
 # Localization
 
@@ -31,13 +45,9 @@ locale:
 
 # Site features
 
-privacy_pack: false
-copyright_license:
-  enable: false
-  allow_derivatives: false
-  share_alike: true
-  allow_commercial: false
-  notice: 'This work is licensed under {license}'
+features:
+  privacy_pack: false
+
 marketing:
   google_analytics: ''
   google_tag_manager: ''

+ 3 - 3
starters/markdown-slides/content/slides/example/index.md

@@ -79,7 +79,7 @@ Make content appear incrementally
 
 Press `Space` to play!
 
-{{% fragment %}} _One_ {{% /fragment %}}
+{{% fragment %}} One {{% /fragment %}}
 {{% fragment %}} **Two** {{% /fragment %}}
 {{% fragment %}} Three {{% /fragment %}}
 
@@ -129,14 +129,14 @@ Press the `S` key to view the speaker notes!
 
 ---
 
-{{< slide background-image="boards.jpg" >}}
+{{< slide background-image="boards.webp" >}}
 
 ## Custom Slide
 
 Customize the slide style and background
 
 ```markdown
-{{</* slide background-image="/media/boards.jpg" */>}}
+{{</* slide background-image="boards.webp" */>}}
 {{</* slide background-color="#0000FF" */>}}
 {{</* slide class="my-style" */>}}
 ```

+ 1 - 0
wowchemy/assets/scss/main.scss

@@ -24,6 +24,7 @@ $sta-link-decoration: {{ $scr.Get "link_decoration" }};
 
 $sta-dark-link: {{ $scr.Get "dark_link" }};
 $sta-dark-link-hover: {{ $scr.Get "dark_link_hover" }};
+$sta-dark-link-decoration: {{ $scr.Get "dark_link_decoration" }};
 
 $sta-menu-primary: {{ $scr.Get "menu_primary" }};
 $sta-menu-text: {{ $scr.Get "menu_text" }};

+ 7 - 0
wowchemy/assets/scss/wowchemy/elements/_content.scss

@@ -119,6 +119,13 @@
   }
 }
 
+.dark .article-style {
+  // Underline links if they are a similar color to the body text.
+  a {
+    text-decoration: $sta-dark-link-decoration;
+  }
+}
+
 .article-metadata {
   margin-bottom: 15px;
   overflow: hidden;

+ 12 - 16
wowchemy/data/themes/1950s.toml

@@ -1,21 +1,17 @@
 # Theme metadata
 name = "1950s"
 
-# Is theme light or dark?
-light = true
+[light]
+  # Primary
+  primary = "#EF525B"
 
-# Primary
-primary = "#EF525B"
+  # Menu
+  menu_primary = "#24C2CB"
+  menu_text = "#fff"
+  menu_text_active = "#00828B"
+  menu_title = "#fff"
 
-# Menu
-menu_primary = "#24C2CB"
-menu_text = "#fff"
-menu_text_active = "#00828B"
-menu_title = "#fff"
-
-# Backgrounds
-background = "#EAE7D6"
-home_section_odd = "#EAE7D6"
-home_section_even = "#EAE7D6"
-
-font = "rose"
+  # Backgrounds
+  background = "#EAE7D6"
+  home_section_odd = "#EAE7D6"
+  home_section_even = "#EAE7D6"

+ 11 - 13
wowchemy/data/themes/apogee.toml

@@ -1,18 +1,16 @@
 # Theme metadata
 name = "Apogee"
 
-# Is theme light or dark?
-light = false
+[dark]
+  # Primary
+  primary = "#EAF04E"
 
-# Primary
-primary = "#EAF04E"
+  # Menu
+  menu_primary = "#312450"
+  menu_text = "#F2BE4E"
+  menu_text_active = "#FFE1A0"
+  menu_title = "#E0A526"
 
-# Menu
-menu_primary = "#312450"
-menu_text = "#F2BE4E"
-menu_text_active = "#FFE1A0"
-menu_title = "#E0A526"
-
-# Home sections
-home_section_odd = "#5e42a6"
-home_section_even = "#5e42a6"
+  # Home sections
+  home_section_odd = "#5e42a6"
+  home_section_even = "#5e42a6"

+ 12 - 16
wowchemy/data/themes/coffee.toml

@@ -1,21 +1,17 @@
 # Theme metadata
 name = "Coffee"
 
-# Is theme light or dark?
-light = true
+[light]
+  # Primary
+  primary = "#795548"
 
-# Primary
-primary = "#795548"
+  # Menu
+  menu_primary = "#795548"
+  menu_text = "rgba(255,255,255,0.6)"
+  menu_text_active = "rgba(255,255,255,1)"
+  menu_title = "#fff"
 
-# Menu
-menu_primary = "#795548"
-menu_text = "rgba(255,255,255,0.6)"
-menu_text_active = "rgba(255,255,255,1)"
-menu_title = "#fff"
-
-# Backgrounds
-background = "hsla(16, 24%, 85%, 1)"
-home_section_odd = "hsla(16, 24%, 85%, 1)"
-home_section_even = "hsla(16, 24%, 80%, 1)"
-
-font = "rose"
+  # Backgrounds
+  background = "hsla(16, 24%, 85%, 1)"
+  home_section_odd = "hsla(16, 24%, 85%, 1)"
+  home_section_even = "hsla(16, 24%, 80%, 1)"

+ 11 - 10
wowchemy/data/themes/cyberpunk.toml

@@ -1,19 +1,20 @@
 # Theme metadata
 name = "Cyberpunk"
 
-# Is theme light or dark?
-is_light = false
+[light]
+  # Primary
+  primary = "rgb(255, 0, 60)"
 
-# Primary
-primary = "rgb(255, 0, 60)"
-
-# Menu
-menu_primary = "#fcee0a"
-menu_text = "#000"
-menu_text_active = "rgb(255, 0, 60)"
-menu_title = "#000"
+  # Menu
+  menu_primary = "#fcee0a"
+  menu_text = "#000"
+  menu_text_active = "rgb(255, 0, 60)"
+  menu_title = "#000"
 
 [dark]
+  # Primary
+  primary = "rgb(255, 0, 60)"
+
   # Menu
   menu_primary = "#fcee0a"
   menu_text = "#000"

+ 11 - 13
wowchemy/data/themes/dark.toml

@@ -1,18 +1,16 @@
 # Theme metadata
 name = "Dark"
 
-# Is theme light or dark?
-light = false
+[dark]
+  # Primary
+  primary = "hsl(339, 90%, 68%)"
 
-# Primary
-primary = "hsl(339, 90%, 68%)"
+  # Menu
+  menu_primary = "rgb(20, 22, 34)"
+  menu_text = "rgba(255,255,255,0.6)"
+  menu_text_active = "rgba(255,255,255,1)"
+  menu_title = "#fff"
 
-# Menu
-menu_primary = "rgb(20, 22, 34)"
-menu_text = "rgba(255,255,255,0.6)"
-menu_text_active = "rgba(255,255,255,1)"
-menu_title = "#fff"
-
-# Home sections
-home_section_odd = "hsla(231, 15%, 18%, 1)"
-home_section_even = "hsla(231, 15%, 16%, 1)"
+  # Home sections
+  home_section_odd = "hsla(231, 15%, 18%, 1)"
+  home_section_even = "hsla(231, 15%, 16%, 1)"

+ 15 - 19
wowchemy/data/themes/earth.toml

@@ -1,25 +1,21 @@
 # Theme metadata
 name = "Earth"
 
-# Is theme light or dark?
-is_light = true
+[light]
+  # Primary
+  primary = "#707070"
 
-# Primary
-primary = "#707070"
+  # Menu
+  menu_primary = "#f6eee9"
+  menu_text = "#000"
+  menu_text_active = "#000"
+  menu_title = "#000"
 
-# Menu
-menu_primary = "#f6eee9"
-menu_text = "#000"
-menu_text_active = "#000"
-menu_title = "#000"
+  # Links
+  link = "#707070"
+  link_hover = "#000"
+  link_decoration = "underline"
 
-# Links
-link = "#707070"
-link_hover = "#000"
-link_decoration = "underline"
-
-# Home sections
-home_section_odd = "#f9f7f6"
-home_section_even = "#ffffff"
-
-font = "rose"
+  # Home sections
+  home_section_odd = "#f9f7f6"
+  home_section_even = "#ffffff"

+ 11 - 13
wowchemy/data/themes/forest.toml

@@ -1,18 +1,16 @@
 # Theme metadata
 name = "Forest"
 
-# Is theme light or dark?
-light = true
+[light]
+  # Primary
+  primary = "#4caf50"
 
-# Primary
-primary = "#4caf50"
+  # Menu
+  menu_primary = "#4caf50"
+  menu_text = "#fff"
+  menu_text_active = "#1b5e20"
+  menu_title = "#fff"
 
-# Menu
-menu_primary = "#4caf50"
-menu_text = "#fff"
-menu_text_active = "#1b5e20"
-menu_title = "#fff"
-
-# Home sections
-home_section_odd = "rgb(255, 255, 255)"
-home_section_even = "rgb(247, 247, 247)"
+  # Home sections
+  home_section_odd = "rgb(255, 255, 255)"
+  home_section_even = "rgb(247, 247, 247)"

+ 14 - 13
wowchemy/data/themes/minimal.toml

@@ -1,22 +1,23 @@
 # Theme metadata
 name = "Minimal"
 
-# Is theme light or dark?
-light = true
+[light]
+  # Primary
+  primary = "#1565c0"
 
-# Primary
-primary = "#1565c0"
+  # Menu
+  menu_primary = "#fff"
+  menu_text = "#34495e"
+  menu_text_active = "#2962ff"
+  menu_title = "#2b2b2b"
 
-# Menu
-menu_primary = "#fff"
-menu_text = "#34495e"
-menu_text_active = "#2962ff"
-menu_title = "#2b2b2b"
-
-# Home sections
-home_section_odd = "rgb(255, 255, 255)"
-home_section_even = "rgb(247, 247, 247)"
+  # Home sections
+  home_section_odd = "rgb(255, 255, 255)"
+  home_section_even = "rgb(247, 247, 247)"
 
 [dark]
+  # Primary
+  primary = "#bbdefb"
+
   link = "#bbdefb"
   link_hover = "#bbdefb"

+ 11 - 13
wowchemy/data/themes/mr_robot.toml

@@ -1,18 +1,16 @@
 # Theme metadata
 name = "Mr Robot"
 
-# Is theme light or dark?
-light = false
+[dark]
+  # Primary
+  primary = "rgb(0, 136, 204)"
 
-# Primary
-primary = "rgb(0, 136, 204)"
+  # Menu
+  menu_primary = "rgb(33, 37, 41)"
+  menu_text = "rgb(0, 136, 204)"
+  menu_text_active = "rgba(255,255,255,1)"
+  menu_title = "rgb(153, 153, 153)"
 
-# Menu
-menu_primary = "rgb(33, 37, 41)"
-menu_text = "rgb(0, 136, 204)"
-menu_text_active = "rgba(255,255,255,1)"
-menu_title = "rgb(153, 153, 153)"
-
-# Home sections
-home_section_odd = "rgb(29, 33, 39)"
-home_section_even = "rgb(29, 33, 39)"
+  # Home sections
+  home_section_odd = "rgb(29, 33, 39)"
+  home_section_even = "rgb(29, 33, 39)"

+ 11 - 13
wowchemy/data/themes/ocean.toml

@@ -1,18 +1,16 @@
 # Theme metadata
 name = "Ocean"
 
-# Is theme light or dark?
-light = true
+[light]
+  # Primary
+  primary = "#3f51b5"
 
-# Primary
-primary = "#3f51b5"
+  # Menu
+  menu_primary = "#3f51b5" # Material 500
+  menu_text = "#fff"
+  menu_text_active = "#ffeb3b" # Material Complemantary 500
+  menu_title = "#fff"
 
-# Menu
-menu_primary = "#3f51b5" # Material 500
-menu_text = "#fff"
-menu_text_active = "#ffeb3b" # Material Complemantary 500
-menu_title = "#fff"
-
-# Home sections
-home_section_odd = "rgb(255, 255, 255)"
-home_section_even = "rgb(247, 247, 247)"
+  # Home sections
+  home_section_odd = "rgb(255, 255, 255)"
+  home_section_even = "rgb(247, 247, 247)"

+ 11 - 13
wowchemy/data/themes/rose.toml

@@ -1,18 +1,16 @@
 # Theme metadata
 name = "Rose"
 
-# Is theme light or dark?
-light = true
+[light]
+  # Primary
+  primary = "rgb(251, 191, 183)"
 
-# Primary
-primary = "rgb(251, 191, 183)"
+  # Menu
+  menu_primary = "rgb(247, 247, 247)"
+  menu_text = "#000"
+  menu_text_active = "rgb(25, 25, 25)"
+  menu_title = "#000"
 
-# Menu
-menu_primary = "rgb(247, 247, 247)"
-menu_text = "#000"
-menu_text_active = "rgb(25, 25, 25)"
-menu_title = "#000"
-
-# Home sections
-home_section_odd = "#FFF"
-home_section_even = "rgb(234, 242, 250)"
+  # Home sections
+  home_section_odd = "#FFF"
+  home_section_even = "rgb(234, 242, 250)"

+ 11 - 13
wowchemy/data/themes/strawberry.toml

@@ -1,18 +1,16 @@
 # Theme metadata
 name = "Strawberry"
 
-# Is theme light or dark?
-light = true
+[light]
+  # Primary
+  primary = "#ff3860"
 
-# Primary
-primary = "#ff3860"
+  # Menu
+  menu_primary = "#ff3860"
+  menu_text = "#fff"
+  menu_text_active = "rgb(208, 255, 56)"
+  menu_title = "#fff"
 
-# Menu
-menu_primary = "#ff3860"
-menu_text = "#fff"
-menu_text_active = "rgb(208, 255, 56)"
-menu_title = "#fff"
-
-# Home sections
-home_section_odd = "#fff"
-home_section_even = "#fff"
+  # Home sections
+  home_section_odd = "#fff"
+  home_section_even = "#fff"

+ 3 - 3
wowchemy/layouts/_default/baseof.html

@@ -4,8 +4,8 @@
 
 {{ partial "site_head" . }}
 
-{{ $show_navbar := site.Params.main_menu.enable | default true }}
-{{- $highlight_active_link := site.Params.main_menu.highlight_active_link | default true -}}
+{{ $show_navbar := site.Params.header.navbar.enable | default true }}
+{{- $highlight_active_link := site.Params.header.navbar.highlight_active_link | default true -}}
 <body id="top" data-spy="scroll" {{ if $show_navbar }}data-offset="70"{{end}} data-target="{{ if or .IsHome (eq .Type "widget_page") | and $highlight_active_link }}#navbar-main{{else}}#TableOfContents{{end}}" class="page-wrapper {{with .Params.design.css_class}}{{.}}{{end}} {{ if not (.Scratch.Get "light") }}dark{{end}} {{ if not $show_navbar }}no-navbar{{end}}" {{with .File}}data-wc-page-id="{{.File.UniqueID}}"{{end}} {{with .Params.design.css_style}}style="{{. | safeCSS}}"{{end}}>
 
   {{/* Initialise Wowchemy. */}}
@@ -13,7 +13,7 @@
   {{ $js_license := $js_license | printf "%s/*! Copyright 2016-present George Cushen (https://georgecushen.com/) */\n" }}
   {{ $js_license := $js_license | printf "%s/*! License: https://github.com/wowchemy/wowchemy-hugo-themes/blob/main/LICENSE.md */\n" }}
   {{ $js_bundle_head := $js_license | resources.FromString "js/bundle-head.js" }}
-  {{ $wcDarkLightEnabled := site.Params.day_night | default false }}
+  {{ $wcDarkLightEnabled := (and site.Params.appearance.theme_day site.Params.appearance.theme_night) }}
   {{ $wcIsSiteThemeDark := not (.Scratch.Get "light") | default false }}
   {{ $js_params := dict "wcDarkLightEnabled" $wcDarkLightEnabled "wcIsSiteThemeDark" $wcIsSiteThemeDark }}
   {{ $js_bundle := resources.Get "js/wowchemy-init.js" | js.Build (dict "params" $js_params) }}

+ 1 - 1
wowchemy/layouts/partials/cookie_consent.html

@@ -1,4 +1,4 @@
-{{ if site.Params.privacy_pack }}
+{{ if site.Params.features.privacy_pack }}
   {{ $scr := .Scratch }}
   {{ $js := site.Data.assets.js }}
   {{ $css := site.Data.assets.css }}

+ 1 - 1
wowchemy/layouts/partials/functions/get_author_name.html

@@ -3,7 +3,7 @@
 {{ $page := . }}
 
 {{/* Get publisher as fall back. */}}
-{{ $publisher := site.Params.org_name | default site.Title }}
+{{ $publisher := site.Params.seo.org_name | default site.Title }}
 
 {{ $author := "" }}
 {{ $author_username := "" }}

+ 51 - 42
wowchemy/layouts/partials/functions/parse_theme.html

@@ -1,14 +1,37 @@
 {{- $scr := .Scratch -}}
 
 {{/* Get name of site's Color Theme. Precedence: Params.yaml > Default (Minimal) */}}
-{{- $theme_index := (site.Params.theme | lower | replaceRE "\\s" "_") | default "minimal" -}}
-{{- if not (isset site.Data.themes $theme_index) -}}
-  {{- warnf "Theme `%s` not found at `data/themes/%s.toml`" site.Params.theme $theme_index -}}
-  {{- $theme_index = "minimal" -}}
+{{- $theme_day_index := (site.Params.appearance.theme_day | lower | replaceRE "\\s" "_") | default "minimal" -}}
+{{- $theme_night_index := (site.Params.appearance.theme_night | lower | replaceRE "\\s" "_") | default "minimal" -}}
+
+{{- if not (index (index site.Data.themes $theme_day_index) "light") -}}
+  {{- warnf "Theme `%s` not found at `data/themes/%s.toml`" site.Params.appearance.theme_day $theme_day_index -}}
+  {{- $theme_day_index = "minimal" -}}
+{{ end }}
+
+{{- if not (index (index site.Data.themes $theme_night_index) "dark") -}}
+  {{- warnf "Theme `%s` not found at `data/themes/%s.toml`" site.Params.appearance.theme_night $theme_night_index -}}
+  {{- $theme_night_index = "minimal" -}}
+{{ end }}
+
+{{ $theme_day := index (index site.Data.themes $theme_day_index) "light" }}
+{{ $theme_night := index (index site.Data.themes $theme_night_index) "dark" }}
+
+{{/* Legacy support for `light` as boolean rather than map. */}}
+{{ $light_is_map := reflect.IsMap $theme_day }}
+{{ if not $light_is_map }}
+  {{ errorf "Upgrade your %s theme pack for v5.5. Convert `light = ...` to `[light]`." $theme_day_index }}
+{{ end }}
+
+{{/* Default CSS body class. */}}
+{{ if site.Params.appearance.theme_day }}
+  {{ $scr.Set "light" true }}
+{{ else }}
+  {{ $scr.Set "light" false }}
 {{ end }}
 
 {{/* Get name of site's Font Set. Precedence: Params.yaml > Inherit from Color Theme > Default (Minimal) */}}
-{{- $font_index := (site.Params.font | lower | replaceRE "\\s" "_") | default ((index site.Data.themes $theme_index).font | lower | replaceRE "\\s" "_") | default $theme_index -}}
+{{- $font_index := (site.Params.appearance.font | lower | replaceRE "\\s" "_") | default ((index site.Data.themes $theme_day_index).font | lower | replaceRE "\\s" "_") | default $theme_day_index -}}
 {{- $font_index := cond (isset site.Data.fonts $font_index) $font_index "minimal" -}}
 
 {{/* Get Font Size. */}}
@@ -30,49 +53,35 @@
 
 {{/* Load Theme. */}}
 
-{{ $theme := index site.Data.themes $theme_index }}
 
-{{/* Legacy support for `light` as boolean rather than map. */}}
-{{ $light_is_map := reflect.IsMap "light" }}
-{{ $light_theme := dict }}
-{{ if $light_is_map }}
-  {{ $scr.Set "light" ($theme.is_light | default true) }}
-  {{ $light_theme = $theme.light }}
+{{ if site.Params.appearance.theme_day }}
+  {{- $scr.Set "primary" ($theme_day.primary | default "#1565c0") -}}
 {{ else }}
-  {{ $scr.Set "light" ($theme.light | default true) }}
+  {{- $scr.Set "primary" ($theme_night.primary | default "#1565c0") -}}
 {{ end }}
 
-{{ if ($scr.Get "light") }}
-  {{- $scr.Set "background" ($theme.background | default "rgb(255, 255, 255)") -}}
-  {{- $scr.Set "dark_background" ($theme.dark.background | default "hsla(231, 15%, 16%, 1)") -}}
-  {{- $scr.Set "home_section_odd" ($theme.home_section_odd | default "rgb(255, 255, 255)") -}}
-  {{- $scr.Set "home_section_even" ($theme.home_section_even | default "rgb(247, 247, 247)") -}}
-  {{- $scr.Set "dark_home_section_odd" ($theme.dark.home_section_odd | default "hsla(231, 15%, 18%, 1)") -}}
-  {{- $scr.Set "dark_home_section_even" ($theme.dark.home_section_even | default "hsla(231, 15%, 16%, 1)") -}}
-{{ else }}
-  {{- $scr.Set "background" ($light_theme.background | default "rgb(255, 255, 255)") -}}
-  {{- $scr.Set "dark_background" ($theme.background | default "rgb(40, 42, 54)") -}}
-  {{- $scr.Set "home_section_odd" ($light_theme.home_section_odd | default "rgb(255, 255, 255)") -}}
-  {{- $scr.Set "home_section_even" ($light_theme.home_section_even | default "rgb(247, 247, 247)") -}}
-  {{- $scr.Set "dark_home_section_odd" ($theme.home_section_odd | default "hsla(231, 15%, 18%, 1)") -}}
-  {{- $scr.Set "dark_home_section_even" ($theme.home_section_even | default "hsla(231, 15%, 16%, 1)") -}}
-{{ end }}
+{{- $scr.Set "background" ($theme_day.background | default "rgb(255, 255, 255)") -}}
+{{- $scr.Set "home_section_odd" ($theme_day.home_section_odd | default "rgb(255, 255, 255)") -}}
+{{- $scr.Set "home_section_even" ($theme_day.home_section_even | default "rgb(247, 247, 247)") -}}
 
-{{- $scr.Set "link" ($theme.link | default $theme.primary) -}}
-{{- $scr.Set "link_hover" ($theme.link_hover | default $theme.primary) -}}
-{{- $scr.Set "dark_link" ($theme.dark.link | default $theme.primary) -}}
-{{- $scr.Set "dark_link_hover" ($theme.dark.link_hover | default $theme.primary) -}}
+{{- $scr.Set "dark_background" ($theme_night.background | default "hsla(231, 15%, 16%, 1)") -}}
+{{- $scr.Set "dark_home_section_odd" ($theme_night.home_section_odd | default "hsla(231, 15%, 18%, 1)") -}}
+{{- $scr.Set "dark_home_section_even" ($theme_night.home_section_even | default "hsla(231, 15%, 16%, 1)") -}}
 
-{{- $scr.Set "link_decoration" ($theme.link_decoration | default "inherit") -}}
+{{- $scr.Set "link" ($theme_day.link | default $theme_day.primary | default ($scr.Get "primary")) -}}
+{{- $scr.Set "link_hover" ($theme_day.link_hover | default $theme_day.primary | default ($scr.Get "primary")) -}}
+{{- $scr.Set "link_decoration" ($theme_day.link_decoration | default "inherit") -}}
 
-{{- $scr.Set "primary" $theme.primary -}}
+{{- $scr.Set "dark_link" ($theme_night.link | default $theme_night.primary | default ($scr.Get "primary")) -}}
+{{- $scr.Set "dark_link_hover" ($theme_night.link_hover | default $theme_night.primary | default ($scr.Get "primary")) -}}
+{{- $scr.Set "dark_link_decoration" ($theme_night.link_decoration | default "inherit") -}}
 
-{{- $scr.Set "menu_primary" $theme.menu_primary -}}
-{{- $scr.Set "menu_text" $theme.menu_text -}}
-{{- $scr.Set "menu_text_active" $theme.menu_text_active -}}
-{{- $scr.Set "menu_title" $theme.menu_title -}}
+{{- $scr.Set "menu_primary" $theme_day.menu_primary -}}
+{{- $scr.Set "menu_text" $theme_day.menu_text -}}
+{{- $scr.Set "menu_text_active" $theme_day.menu_text_active -}}
+{{- $scr.Set "menu_title" $theme_day.menu_title -}}
 
-{{- $scr.Set "dark_menu_primary" ($theme.dark.menu_primary | default "rgb(40, 42, 54)") -}}
-{{- $scr.Set "dark_menu_text" ($theme.dark.menu_text | default "white") -}}
-{{- $scr.Set "dark_menu_text_active" ($theme.dark.menu_text_active | default "rgba(255, 255, 255, 0.8)") -}}
-{{- $scr.Set "dark_menu_title" ($theme.dark.menu_title | default "white") -}}
+{{- $scr.Set "dark_menu_primary" ($theme_night.menu_primary | default "rgb(40, 42, 54)") -}}
+{{- $scr.Set "dark_menu_text" ($theme_night.menu_text | default "white") -}}
+{{- $scr.Set "dark_menu_text_active" ($theme_night.menu_text_active | default "rgba(255, 255, 255, 0.8)") -}}
+{{- $scr.Set "dark_menu_title" ($theme_night.menu_title | default "white") -}}

+ 1 - 1
wowchemy/layouts/partials/jsonld/article.html

@@ -9,7 +9,7 @@
 {{ end }}
 
 {{ $author := partial "functions/get_author_name" $page }}
-{{ $publisher := site.Params.org_name | default site.Title }}
+{{ $publisher := site.Params.seo.org_name | default site.Title }}
 {{ $logo_url := partial "functions/get_logo_url" $page -}}
 
 <script type="application/ld+json">

+ 3 - 3
wowchemy/layouts/partials/jsonld/business.html

@@ -2,12 +2,12 @@
 <script type="application/ld+json">
 {
   "@context": "https://schema.org",
-  "@type": {{site.Params.local_business_type | default site.Params.site_type}},
+  "@type": {{site.Params.seo.site_type | default site.Params.seo.site_type}},
   "@id": {{site.BaseURL}},
-  "name": {{site.Params.org_name | default site.Title}},
+  "name": {{site.Params.seo.org_name | default site.Title}},
   "logo": {{ partial "functions/get_logo_url" . }},
   {{with $sharing_image}}"image": {{.Permalink}},{{end}}
-  {{ if (eq site.Params.site_type "LocalBusiness") | and site.Params.coordinates }}
+  {{ if (eq site.Params.seo.site_type "LocalBusiness") | and site.Params.coordinates }}
   "geo": {
     "@type": "GeoCoordinates",
     "latitude": {{site.Params.coordinates.latitude}},

+ 1 - 1
wowchemy/layouts/partials/jsonld/main.html

@@ -1,6 +1,6 @@
 {{ $page := .page }}
 {{ $summary := .summary }}
-{{ $site_type := site.Params.site_type | default "Person" }}
+{{ $site_type := site.Params.seo.site_type | default "Person" }}
 
 {{- if $page.IsHome -}}
 

+ 1 - 1
wowchemy/layouts/partials/marketing/google_analytics.html

@@ -2,7 +2,7 @@
 
 {{ if hugo.IsProduction | and $ga }}
 
-{{ $gtag_config := cond site.Params.privacy_pack "{ 'anonymize_ip': true }" "{}" }}
+{{ $gtag_config := cond site.Params.features.privacy_pack "{ 'anonymize_ip': true }" "{}" }}
 <script async src="https://www.googletagmanager.com/gtag/js?id={{$ga}}"></script>
 <script>
   window.dataLayer = window.dataLayer || [];

+ 10 - 9
wowchemy/layouts/partials/navbar.html

@@ -1,12 +1,12 @@
-{{ $show_navbar := site.Params.main_menu.enable | default true }}
+{{ $show_navbar := site.Params.header.navbar.enable | default true }}
 {{ if $show_navbar }}
 
 {{ $current_page := . }}
-{{ $highlight_active_link := site.Params.main_menu.highlight_active_link | default true }}
-{{ $show_current_language := site.Params.main_menu.show_language | default false }}
+{{ $highlight_active_link := site.Params.header.navbar.highlight_active_link | default true }}
+{{ $show_current_language := site.Params.header.navbar.show_language | default false }}
 
 {{/* Get site logo. */}}
-{{ $show_logo := site.Params.main_menu.show_logo | default true }}
+{{ $show_logo := site.Params.header.navbar.show_logo | default true }}
 {{ $has_logo := fileExists "assets/media/logo.png" | or (fileExists "assets/media/logo.svg") }}
 {{ $logo := "" }}
 {{ if $has_logo }}
@@ -53,7 +53,7 @@
       {{end}}
 
       <!-- Collect the nav links, forms, and other content for toggling -->
-      {{ $align_menu := site.Params.main_menu.align | default "l" }}
+      {{ $align_menu := site.Params.header.navbar.align | default "l" }}
       <div class="navbar-collapse main-menu-item collapse {{ if eq $align_menu "c" }}justify-content-center{{ else if eq $align_menu "r" }}justify-content-end{{else}}justify-content-start{{ end }}" id="navbar-content">
 
         <!-- Left Nav Bar -->
@@ -157,15 +157,16 @@
           {{ end }}
         {{ end }}
 
-        {{ $show_search := site.Params.main_menu.show_search | default true }}
+        {{ $show_search := site.Params.header.navbar.show_search | default true }}
         {{ if and site.Params.search.provider $show_search }}
         <li class="nav-item">
           <a class="nav-link js-search" href="#" aria-label="{{ i18n "search" }}"><i class="fas fa-search" aria-hidden="true"></i></a>
         </li>
         {{ end }}
 
-        {{ $show_day_night := site.Params.main_menu.show_day_night | default true }}
-        {{ if and site.Params.day_night $show_day_night }}
+        {{ $show_day_night := site.Params.header.navbar.show_day_night | default true }}
+        {{ $has_day_night_themes := (and site.Params.appearance.theme_day site.Params.appearance.theme_night) }}
+        {{ if and $has_day_night_themes $show_day_night }}
         <li class="nav-item dropdown theme-dropdown">
           <a href="#" class="nav-link" data-toggle="dropdown" aria-haspopup="true" aria-label="{{ i18n "theme_selector" | default "Display preferences" }}">
             <i class="fas fa-moon" aria-hidden="true"></i>
@@ -184,7 +185,7 @@
         </li>
         {{ end }}
 
-        {{ $show_translations := site.Params.main_menu.show_translations | default true }}
+        {{ $show_translations := site.Params.header.navbar.show_translations | default true }}
         {{ if .IsTranslated | and $show_translations }}
         <li class="nav-item dropdown i18n-dropdown">
           <a href="#" class="nav-link {{ if $show_current_language }}dropdown-toggle{{end}}" data-toggle="dropdown"

+ 1 - 1
wowchemy/layouts/partials/page_author_card.html

@@ -1,6 +1,6 @@
 {{ $page := .page }}
 {{ $author_page := .author_page }}
-{{ $site_type := site.Params.site_type | default "Person" }}
+{{ $site_type := site.Params.seo.site_type | default "Person" }}
 {{- $has_profile := not (eq nil $author_page.Params.superuser) -}}
 
 {{/* Check an author profile exists. */}}

+ 2 - 2
wowchemy/layouts/partials/site_footer.html

@@ -24,9 +24,9 @@
   </p>
   {{ end }}
 
-  {{ with site.Copyright }}
+  {{ with site.Params.footer.text }}
   <p class="powered-by">
-    {{ replace . "{year}" now.Year | markdownify }}
+    {{ . | markdownify | emojify }}
   </p>
   {{ end }}
 

+ 15 - 7
wowchemy/layouts/partials/site_footer_license.html

@@ -1,13 +1,13 @@
 {{/* Display copyright license. */}}
 
-{{ $copyright_license := .Params.copyright_license | default site.Params.copyright_license }}
+{{ $copyright_license := .Params.copyright.license | default site.Params.footer.copyright.license }}
+{{ $notice := .Params.copyright.notice | default site.Params.footer.copyright.notice }}
 
-{{ if and $copyright_license $copyright_license.enable }}
+{{ if ($copyright_license.enable | default false) }}
 
-  {{ $notice := .Params.copyright_license.notice | default site.Params.copyright_license.notice }}
-  {{ $allow_commercial := .Params.copyright_license.allow_commercial | default site.Params.copyright_license.allow_commercial }}
-  {{ $allow_derivatives := .Params.copyright_license.allow_derivatives | default site.Params.copyright_license.allow_derivatives }}
-  {{ $share_alike := .Params.copyright_license.share_alike | default site.Params.copyright_license.share_alike }}
+  {{ $allow_commercial := .Params.copyright.license.allow_commercial | default site.Params.copyright.license.allow_commercial }}
+  {{ $allow_derivatives := .Params.copyright.license.allow_derivatives | default site.Params.copyright.license.allow_derivatives }}
+  {{ $share_alike := .Params.copyright.license.share_alike | default site.Params.copyright.license.share_alike }}
 
   {{ $cc_code := "by" }}
   {{ if not $allow_commercial }}
@@ -23,7 +23,7 @@
 
   {{ with $notice }}
   <p class="powered-by copyright-license-text">
-    {{ replace . "{license}" (printf "<a href=\"%s\" rel=\"noopener noreferrer\" target=\"_blank\">CC %s 4.0</a>" $license_url (replace $cc_code "-" " " | upper)) | markdownify }}
+    {{ replace (replace . "{year}" now.Year) "{license}" (printf "<a href=\"%s\" rel=\"noopener noreferrer\" target=\"_blank\">CC %s 4.0</a>" $license_url (replace $cc_code "-" " " | upper)) | markdownify }}
   </p>
   {{ end }}
 
@@ -42,4 +42,12 @@
     </a>
   </p>
 
+{{ else }}
+
+  {{ with $notice }}
+  <p class="powered-by copyright-license-text">
+    {{ replace . "{year}" now.Year | markdownify }}
+  </p>
+  {{ end }}
+
 {{ end }}

+ 3 - 3
wowchemy/layouts/partials/site_head.html

@@ -68,8 +68,8 @@
     {{ $desc = .Params.abstract }}
   {{ else if .IsPage }}
     {{ $desc = .Summary }}
-  {{ else if site.Params.description }}
-    {{ $desc = site.Params.description }}
+  {{ else if site.Params.seo.org_name }}
+    {{ $desc = site.Params.seo.org_name }}
   {{ else }}
     {{ $desc = $superuser_role }}
   {{ end }}
@@ -272,7 +272,7 @@
     {{ if ne $title site.Title }}{{ $title = printf "%s | %s" $title site.Title }}{{ end }}
   {{ end }}
   <meta property="twitter:card" content="{{ $twitter_card }}" />
-  {{ with site.Params.twitter }}
+  {{ with site.Params.seo.twitter }}
     <meta property="twitter:site" content="@{{ . }}" />
     <meta property="twitter:creator" content="@{{ . }}" />
   {{ end }}