Skip to content

Commit

Permalink
[18F#17] Add metadata for sources
Browse files Browse the repository at this point in the history
  • Loading branch information
albertvolkman committed Feb 18, 2017
1 parent 6285aa6 commit 0a4a6a2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions _plugins/jekyll_get.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ def generate(site)
begin
target = site.data[d['data']]
source = JSON.load(open(d['json']))

if d['meta']
meta = d['meta']

source['items'].each { |item|
item['meta'] = meta
}
end

if target
HashJoiner.deep_merge target, source
else
Expand Down
9 changes: 9 additions & 0 deletions jekyll_get.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ def generate(site)
begin
target = site.data[d['data']]
source = JSON.load(open(d['json']))

if d['meta']
meta = d['meta']

source['items'].each { |item|
item['meta'] = meta
}
end

if target
HashJoiner.deep_merge target, source
else
Expand Down

0 comments on commit 0a4a6a2

Please sign in to comment.