Utilize previously allocated local variable

Follow-up to aa9a416
This commit is contained in:
Ashwin Maroli 2021-08-30 14:33:21 +05:30 committed by GitHub
parent e482574b84
commit 1aea1580c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -237,12 +237,11 @@ module Jekyll
page = context.registers[:page] page = context.registers[:page]
return unless page&.key?("path") return unless page&.key?("path")
page_path = context.registers[:page]["path"]
absolute_path = \ absolute_path = \
if page["collection"] if page["collection"]
@site.in_source_dir(@site.config["collections_dir"], page_path) @site.in_source_dir(@site.config["collections_dir"], page["path"])
else else
@site.in_source_dir(page_path) @site.in_source_dir(page["path"])
end end
@site.regenerator.add_dependency(absolute_path, inclusion.path) @site.regenerator.add_dependency(absolute_path, inclusion.path)