There is no support for using Rust in any way to generate websites, correct? Is some kind of Rust API planned?


So after skimming through the docs, it seems there is no way to use Rust code to manipulate the generation of websites.

Is something like this planned?

I’m coming from Gatsby, which basically allows me to do anything I want (which is an advantage and disadvantage at the same time – especially when it comes to shipping something… :wink: ).

As an example, I’d be interested to add support for Tailwind to my site. One approach would be to create a shortcode/macro like:

{% html(tag="div", tw="{tailwind-classes") %}
The content
{% end %}

And then within the macro (if there was the possibility to execute Rust code) to write the used Tailwind classes to a file, which then can be used to prune the generated Tailwind CSS file.

(This is just an example to illustrate what kind of stuff I’d like to be able to do. There is most likely an easier way to integrate Tailwind.)

What I want to say is, that fundamentally, something like the above isn’t possible, right?

Not with Zola shortcuts, and not via Tera (at least I don’t see a way to add Rust functions to Tera templates).

You can add your own Tera functions in Tera but not in Zola. If you want to add a macro that writes to a file like in your example it would be (easily) doable but you need to fork Zola and add it in your fork.