diff --git a/_plugins/jekyll_get.rb b/_plugins/jekyll_get.rb index f5fb7e3..298679e 100644 --- a/_plugins/jekyll_get.rb +++ b/_plugins/jekyll_get.rb @@ -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 diff --git a/jekyll_get.rb b/jekyll_get.rb index f5fb7e3..298679e 100644 --- a/jekyll_get.rb +++ b/jekyll_get.rb @@ -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