Templates outside templates folder


I am developing several sites with zola, and find it magnificent. One issue is that there is some common content between the sites, and it would be good to share that with templates/macros.

Is there a way to include templates/macros from outside the templates folder?

At the moment I am using softlinks, but that has 2 problems. a) zola does not pick up changes in files in softlinked folders, and b) softlinks dont survive syncing to different operating systems.

or is there a different solution to such problems?

best, jack

1 Like

No way to handle that currently. I guess it could work as a theme maybe?

1 Like

Thanks @keats, yes I considered themes, in this specific case will not work.

Then doing it in javascript loaded from a central url is one alternative.

again, thanks for a great ssg.

1 Like

I raised the same issue before. The challenge with using themes as you know is that it requires duplicating the macro code in every theme that uses it.

I do not normally wish for new features as I share your philosophy of minimalist software. But I think having a way to share macro code between sites and themes is one of those rare things that Zola truly needs. I imagine it as simple (from the user perspective) as adding an “include path” to the config file of whatever site/theme needs to use a library of macros. I think that will actually help keep Zola minimal as many requested features can hopefully be implemented as Zola macros and distributed as libraries. Just a thought. Thanks,

I meant that you could create a themes for your macros and re-use that for your sites.

You mean I could use more than one theme in one site?

Ah no that doesn’t work if you’re already using a theme