Created
August 22, 2024 17:29
-
-
Save trovster/4a3a7fe7b57f5e7e6f7f65f633f25492 to your computer and use it in GitHub Desktop.
Simplify adding filters in Eleventy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (const [name, filter] of Object.entries(filters)) { | |
if (['getDescription', 'getRSSlink'].includes(name)) { | |
eleventyConfig.addAsyncFilter(name, filter) | |
} else { | |
eleventyConfig.addFilter(name, filter) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment