Browse Source

fix: case when font and color themes not found even when present

See #1118
George Cushen 6 years ago
parent
commit
a71297bbfd
1 changed files with 2 additions and 2 deletions
  1. 2 2
      layouts/partials/functions/parse_theme.html

+ 2 - 2
layouts/partials/functions/parse_theme.html

@@ -2,7 +2,7 @@
 
 {{/* Attempt to load font style specified by user. */}}
 {{- $font_index := site.Params.font | default "default" -}}
-{{ if isset site.Data.fonts $font_index }}
+{{ if (index site.Data.fonts $font_index) }}
   {{- $font := index site.Data.fonts $font_index -}}
   {{- $scr.Set "google_fonts" $font.google_fonts -}}
   {{- $scr.Set "body_font" $font.body_font -}}
@@ -17,7 +17,7 @@
 
 {{/* Attempt to load color theme specified by user. */}}
 {{- $theme_index := site.Params.color_theme | default "default" -}}
-{{ if isset site.Data.themes $theme_index }}
+{{ if (index site.Data.themes $theme_index) }}
   {{ $theme := index site.Data.themes $theme_index }}
 
   {{- $scr.Set "light" ($theme.light | default true) -}}