Skip to content

Commit

Permalink
Merge pull request 18F#6 from 18F/data_source_default
Browse files Browse the repository at this point in the history
Use `_data` if `data_source` not set in configuration
  • Loading branch information
afeld committed Jan 7, 2016
2 parents c0018d9 + d1e7f3e commit 6285aa6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion _plugins/jekyll_get.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ def generate(site)
site.data[d['data']] = source
end
if d['cache']
path = "#{site.config['data_source']}/#{d['data']}.json"
data_source = (site.config['data_source'] || '_data')
path = "#{data_source}/#{d['data']}.json"
open(path, 'wb') do |file|
file << JSON.generate(site.data[d['data']])
end
Expand Down
3 changes: 2 additions & 1 deletion jekyll_get.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ def generate(site)
site.data[d['data']] = source
end
if d['cache']
path = "#{site.config['data_source']}/#{d['data']}.json"
data_source = (site.config['data_source'] || '_data')
path = "#{data_source}/#{d['data']}.json"
open(path, 'wb') do |file|
file << JSON.generate(site.data[d['data']])
end
Expand Down

0 comments on commit 6285aa6

Please sign in to comment.