Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macros should not rely on outside variables #25

Open
Keats opened this issue Dec 5, 2021 · 2 comments
Open

Macros should not rely on outside variables #25

Keats opened this issue Dec 5, 2021 · 2 comments

Comments

@Keats
Copy link

Keats commented Dec 5, 2021

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
Copy link
Owner

aaranxu commented Dec 13, 2021

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

@Jieiku
Copy link

Jieiku commented Aug 18, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants