You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before this change, with Jekyll 4.2.0 all news archive pages used
`news.html` as layout, also the yearly and monthly archive pages,
leading to wrong sidebars that list "Archives by Year" (without
any entries) and "Syndicate".
The reason is that `Page#relative_path` is a memoized value
and Jekyll 4.2.0 changes when `relative_path` is first called
during generation of the archive pages.
Other than before it is now called from `read_yaml`, see
jekyll/jekyll@2608640
`YearlyArchive` and `MonthlyArchive` call `ArchivePage#new`
(via `super`), which uses `read_yaml`, so that from then on
`relative_path` is set and will not change anymore.
Therefore the reassignments of `@dir` in YearlyArchive and
MonthlyArchive after the `super` calls have no effect on
`relative_path`. Hence *all* archive pages have their
relative path set to `<lang>/news/index.html`.
Then for rendering, apparently the content of the page under the
relative path is used (i.e. the `news.html` layout) instead of
the in fact correctly set `content` of the respective archive page
(i.e. `news_archive_year.html` or `news_archive_month.html`).
This issue is fixed by not changing `@dir` after calling `super`.
0 commit comments