sverrirs / jekyll-paginate-v2

Pagination Generator for Jekyll 3 (enhanced replacement for the old built-in jekyll-paginate gem) ⛺
https://rubygems.org/gems/jekyll-paginate-v2
MIT License
521 stars 288 forks source link

Frontmatter defaults in _config.yml are not correctly applying to pagination pages #254

Open UlyssesZh opened 1 year ago

UlyssesZh commented 1 year ago

Frontmatter defaults in _config.yml are not applying to pagination pages. This is because frontmatter defaults rely on Convertible#relative_path:

https://github.com/jekyll/jekyll/blob/d86ba153fe012fbf4c62dc4af9dd73df1f1cfd58/lib/jekyll/convertible.rb#L249-L251

Then, PaginationPage inherits #relative_path from Page, where this method is dependent on @dir:

https://github.com/jekyll/jekyll/blob/d86ba153fe012fbf4c62dc4af9dd73df1f1cfd58/lib/jekyll/page.rb#L143-L146

However, PaginationPage objects have their @dir to be nil, so the path information is wrong when Convertible#to_liquid looks at their frontmatter defaults.