Open MaoHolden opened 2 months ago
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 reading_time
in https://www.getzola.org/documentation/templates/pages-sections/
Was it for a non latin language?
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 🤩.