Skip to content

Commit e2490f2

Browse files
authored
Don't fail if the theme doesn't have a data dir (#36)
1 parent 7aee1fb commit e2490f2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/jekyll-data/reader.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ class Reader < Jekyll::Reader
77
def initialize(site)
88
@site = site
99
@theme = site.theme
10-
@theme_data_files = Dir[File.join(site.theme.data_path, "**", "*.{yaml,yml,json,csv,tsv}")]
10+
11+
if @theme.data_path
12+
@theme_data_files = Dir[File.join(@theme.data_path, "**", "*.{yaml,yml,json,csv,tsv}")]
13+
end
1114
end
1215

1316
# Read data files within theme-gem.

0 commit comments

Comments
 (0)