diff --git a/lib/jekyll-github-metadata/metadata_drop.rb b/lib/jekyll-github-metadata/metadata_drop.rb index 76f6535..af5f6bd 100644 --- a/lib/jekyll-github-metadata/metadata_drop.rb +++ b/lib/jekyll-github-metadata/metadata_drop.rb @@ -8,6 +8,9 @@ class MetadataDrop < Jekyll::Drops::Drop mutable true + # See https://github.com/jekyll/jekyll/pull/6338 + alias_method :invoke_drop, :[] + def to_s require "json" JSON.pretty_generate to_h diff --git a/spec/site_github_munger_spec.rb b/spec/site_github_munger_spec.rb index 3d765d8..0de9287 100644 --- a/spec/site_github_munger_spec.rb +++ b/spec/site_github_munger_spec.rb @@ -43,11 +43,11 @@ let(:github_namespace) { { "source" => { "branch" => "foo" } } } it "lets user-specified values override the drop" do - expect(site.config["github"]["source"]["branch"]).to eql("foo") + expect(site.config["github"].invoke_drop("source")["branch"]).to eql("foo") end it "still sets other values" do - expect(site.config["github"]["source"]["path"]).to eql("/") + expect(site.config["github"].invoke_drop("source")["path"]).to eql("/") end end