You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While rendering pages, I am using shortcodes to accumulate CSS classes I'd like to generate. I'm hoping to then dump them all in a .css file at the end of the build.
From reading the docs, it seems like eleventyComputed could do this. I am able to generate a .css file that spits out a value from eleventyComputed. My problem is this value is determined at the beginning of eleventy's build, not at the end. I need to write out all my pages (which call the shortcodes that generate the CSS classes), and then at the end, spit out the CSS.
In case it helps, the build order looks like this:
Setting myGeneratedCSS in .eleventy.js
Getting generatedCSS (eleventyComputed) now.
[11ty] Writing _site/404.html from ./404.njk
[11ty] Writing _site/posts/2022-manila/index.html from ./posts/writing/travel/2022-manila.md (njk)
[11ty] Writing _site/posts/2022-penang/index.html from ./posts/writing/travel/2022-penang.md (njk)
[11ty] Writing _site/posts/2022-seoul/index.html from ./posts/writing/travel/2022-seoul.md (njk)
...
I need the second step (Getting generatedCSS (eleventyComputed) now.) to happen at the end of the build, because the value is modified throughout the build process.
This might be impossible using eleventyComputed. If so, I would love a suggestion for how to accomplish my task in Eleventy!
Apologies if this is unclear, I'm happy to provide more details or another shot at the description if that'd be helpful.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello!
While rendering pages, I am using shortcodes to accumulate CSS classes I'd like to generate. I'm hoping to then dump them all in a .css file at the end of the build.
From reading the docs, it seems like
eleventyComputed
could do this. I am able to generate a .css file that spits out a value fromeleventyComputed
. My problem is this value is determined at the beginning of eleventy's build, not at the end. I need to write out all my pages (which call the shortcodes that generate the CSS classes), and then at the end, spit out the CSS.In case it helps, the build order looks like this:
I need the second step (
Getting generatedCSS (eleventyComputed) now.
) to happen at the end of the build, because the value is modified throughout the build process.This might be impossible using
eleventyComputed
. If so, I would love a suggestion for how to accomplish my task in Eleventy!Apologies if this is unclear, I'm happy to provide more details or another shot at the description if that'd be helpful.
Beta Was this translation helpful? Give feedback.
All reactions