Had an issue using the default 11ty getPreviousCollectionItem and getNextCollectionItem filters. When using these filters in a macro the page object is not available. It is possible to pass the page object however a bug in the code checks value of this.page.lang to find the current language to resolve a locale page and results in an error despite passing in the page. The workaround is to also pass langCode which bypasses the bug. 11ty code references are below.
Had an issue using the default 11ty
getPreviousCollectionItem
andgetNextCollectionItem
filters. When using these filters in a macro thepage
object is not available. It is possible to pass thepage
object however a bug in the code checks value ofthis.page.lang
to find the current language to resolve a locale page and results in an error despite passing in thepage
. The workaround is to also passlangCode
which bypasses the bug. 11ty code references are below.Current solution passes
page
object from the template and then passpage
and hardcodedlangCode
to the filter in the macro.resolves #60