diff --git a/lib/jekyll/page.rb b/lib/jekyll/page.rb index c1691156..8e516255 100644 --- a/lib/jekyll/page.rb +++ b/lib/jekyll/page.rb @@ -50,7 +50,7 @@ module Jekyll read_yaml(File.join(base, dir), name) data.default_proc = proc do |_, key| - site.frontmatter_defaults.find(File.join(dir, name), type, key) + site.frontmatter_defaults.find(relative_path, type, key) end Jekyll::Hooks.trigger :pages, :post_init, self @@ -144,7 +144,7 @@ module Jekyll # The path to the page source file, relative to the site source def relative_path - File.join(*[@dir, @name].map(&:to_s).reject(&:empty?)).sub(%r!\A\/!, "") + @relative_path ||= File.join(*[@dir, @name].map(&:to_s).reject(&:empty?)).sub(%r!\A\/!, "") end # Obtain destination path.