aaranxu / adidoks

AdiDoks is a mordern documentation theme, which is a port of the Hugo theme Doks for Zola.
https://adidoks.org
MIT License
220 stars 80 forks source link

Macros should not rely on outside variables #25

Open Keats opened 2 years ago

Keats commented 2 years ago

Macros are meant to be pure functions (args) -> String. The fact that you can access config etc from inside is a pretty big bug in Tera and will very likely get fixed soonish. You should pass explicitly the arguments you need.

aaranxu commented 2 years ago

You're right. I will make some updates next.

Jieiku commented 1 year ago

I was not aware of this, will have to work on fixing abridge as well.

Hopefully zola build and zola serve will post some warning message about the intended functionality, otherwise users of many themes will be very surprised and scrambling to fix things.

I have added this to my todo list and will work on it soon.