Skip to content

Commit

Permalink
feat: display more specific warning if theme variation doesn't exist (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
anirbanbasu authored Oct 2, 2022
1 parent b2e1006 commit 82a4452
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/wowchemy/layouts/partials/functions/parse_theme.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
{{- $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 -}}
{{- warnf "In `params.yaml`, you requested `theme_day: %s` but there is not a `light` style in `data/themes/%s.toml`. Falling back to default light style." 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 -}}
{{- warnf "In `params.yaml`, you requested `theme_night: %s` but there is not a `dark` style in `data/themes/%s.toml`. Falling back to default dark style." site.Params.appearance.theme_night $theme_night_index -}}
{{- $theme_night_index = "minimal" -}}
{{ end }}

Expand Down

0 comments on commit 82a4452

Please sign in to comment.