Skip to content

Commit

Permalink
liquid 5 support: be flexible when reading registers
Browse files Browse the repository at this point in the history
Before Liquid 5.4, context.registers are good old plain Hash.
 After Liquid 5.4, context.registers is_a Liquid::Registers
  • Loading branch information
isimluk committed Dec 25, 2022
1 parent 7cb6c87 commit 22961f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/jekyll/tags/include.rb
Expand Up @@ -254,7 +254,8 @@ def tag_includes_dirs(context)
end

def page_path(context)
page, site = context.registers.values_at(:page, :site)
page = context.registers.fetch(:page, nil)
site = context.registers.fetch(:site, nil)
return site.source unless page

site.in_source_dir File.dirname(resource_path(page, site))
Expand Down

0 comments on commit 22961f5

Please sign in to comment.