Open UlyssesZh opened 1 year ago
Frontmatter defaults in _config.yml are not applying to pagination pages. This is because frontmatter defaults rely on Convertible#relative_path:
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:
PaginationPage
#relative_path
Page
@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.
nil
Convertible#to_liquid
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
fromPage
, 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 benil
, so the path information is wrong whenConvertible#to_liquid
looks at their frontmatter defaults.