skanjo / samer.kanjo.net

The personal web site of Samer Kanjo
https://samer.kanjo.net
0 stars 0 forks source link

(#60) add next and previous links to bytes #62

Closed skanjo closed 4 months ago

skanjo commented 4 months ago

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.

Current solution passes page object from the template and then pass page and hardcoded langCode to the filter in the macro.

resolves #60