Simplify retrieval of collections.all in getLocaleCollectionItem - #3785
Simplify retrieval of collections.all in getLocaleCollectionItem#3785noelforte wants to merge 6 commits into
getLocaleCollectionItem#3785Conversation
|
Sorry to bug you Zach, any inclination on when this might get reviewed? Is there something that I could do to help push things along? |
…gines missing `ctx` variables)
faa4a92 to
0c16992
Compare
|
@zachleat Just confirming, is this PR on hold for a specific reason? It's not been tagged as |
|
I came at this function from a different angle (pagination rather than a Applying the change as it stands, The reason looks like the two branches being dropped are the ones doing the
The filter context is Happy to share the rig if it is useful. |
This change motivated by: noelforte/eleventy-plugin-vento#221
I couldn't figure out why the i18n plugin's presence was breaking the
getNextCollectionItemandgetPreviousCollectionItemfilters since the Vento template engine plugin doesn't do anything fancy with the filters.After a lot of trial and error, I discovered that this search for collections.all at the very end of the
GetLocaleCollectionItemmodule checks a lot of things specific to Eleventy's own internal engines but of course custom engines don't add actxorcontextobject, or eventhis.collections, sincethis.pageandthis.eleventyare the only context keys Eleventy supports, andcollectionsis already accessible in page data anyway.Rather than add
this.collectionsto the Vento custom engine, could we simplify thealldeclaration to search thedatakey instead since thedatakey is already available on the render context anyway?If not, I can look into adding
this.collectionsto the custom engine for my plugin, but if this can be handled upstream that puts less pressure on custom engines to support adding it.Thanks Zach!