tera icon indicating copy to clipboard operation
tera copied to clipboard

Including a macro only once.

Open PaulHMason opened this issue 2 years ago • 1 comments

I have a bunch of macros that generate various components and each have their own "CSS macro" with their styles. I want to be able to use the component macros multiple times, but only include the corresponding CSS macro once. Is there a way to conditionally render macro content based on some global state that can be set the first time a macro runs; or some other way of only including a macro once (other than explicitly including them separately in the template)?

PaulHMason avatar Mar 03 '23 07:03 PaulHMason

No way to do that, macros are pure functions

Keats avatar Mar 03 '23 13:03 Keats