Why Nostr? What is Njump?
2024-10-11 09:54:01

Nicolas Hoizey on Nostr: In npub1mcqvh…wc7d9's Eleventy Excellent starter project for npub1z9mgj…jrz2z, ...

In 's Eleventy Excellent starter project for , the filters are loaded with https://github.com/madrilene/eleventy-excellent/blob/main/src/_config/filters.js that lists them one after the other.

Is there a way in ESM to do this dynamicaly?

That's what I did in CJS in my Pack11ty plugin:
https://github.com/nhoizey/eleventy-plugin-pack11ty/blob/main/eleventy-plugin-pack11ty.js#L68-L77

I tried with dynamic import(), but failed.
https://github.com/nhoizey/eleventy-plugin-pack11ty/blob/11ty3/eleventy-plugin-pack11ty.js#L98-L107

This code runs fine, but then the filters are not found by Eleventy when they're used in templates.

#Eleventy #11ty
Author Public Key
npub1ncrs5ctpvn83qg7kl9jn4na2czq2593889p2qw6lns7pjwzrgrksrgl42r