Mutate site payload instead of duplicating it (#419)

Merge pull request 419
This commit is contained in:
Ashwin Maroli 2020-10-18 14:06:55 +05:30 committed by GitHub
parent 20d61fa728
commit a1e0cdd25f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 6 deletions

View File

@ -47,12 +47,11 @@ module Jekyll
def payload
# site_payload is an instance of UnifiedPayloadDrop. See https://git.io/v5ajm
Jekyll::Utils.deep_merge_hashes(
context.registers[:site].site_payload,
"page" => context.registers[:page],
"paginator" => context["paginator"],
"seo_tag" => drop
)
context.registers[:site].site_payload.tap do |site_payload|
site_payload["page"] = context.registers[:page]
site_payload["paginator"] = context["paginator"]
site_payload["seo_tag"] = drop
end
end
def drop