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
Register a function in Tera #2493
Comments
It's not possible currently. For the next version of Tera, i'm thinking of allowing some scripting language like https://rhai.rs/ or wasm functions. Not coming anytime soon though. |
Got it, sounds like a cool idea :). I was checking the docs I the only place I see to put a comment about this is in /documentation/templates/overview/. You reckon its useful or just with this Issue is enough? |
Note that for this specific feature we do have a very crude version. See |
Yeah I'm using that already :). Thanks!. Also if you want I could make a PR with a small comment about not having support for registering custom functions to Tera. If you don't think its necessary you can just close the Issue 🙂 |
sure but I think right now it's implicit it's not supported. It wouldn't hurt to write it int he docs though |
Register a Tera function in order to execute complex logic like calculating read time.
Summary
Zola uses the Tera engine, I would like to calculate the read time of my markdown posts. One way I thing it could be done is by adding a Rust function in the Tera engine using
tera.register_function
but I don't see how this can be done in the documentation.Proposed solution
Either specify that its not possible yet or document how.
Greetings
Thank you for the great framework 🤩.
The text was updated successfully, but these errors were encountered: