Is there a reasonable way for Hugo to add another template language?

Go Templates are powerful but somewhat difficult to learn and difficult to come back to after some time has passed. Crusing the Internet, I see that some don’t use Hugo because of that. Zola was created because its author liked Hugo, but hated Go Templates.

Template languages such as Liquid, Jinja, Nunjucks, and even Tera share a similar style that is very different from Go Templates. I’d argue that they are easier to learn, easier to read, and would make the transition to Hugo easier for many developers.

I understand that these other template languages are interpreted by the likes of JavaScript, Python, and Rust. Go drives Go Templates, of course.

How monumental would the effort be to implement?

As to your main answer: No. It would not be pracctical.

I do understand where these questions from, though.

For most common Hugo sites, Go templates are more than good enough, and once you get to know it, it’s very pleasant to use compared to some other constructs.

But there are some rare situations where it would be very nice to have a proper scripting/program language – and that will certainly happen in Hugop. E.g. use JavaScript or Python inline in Go templates to do some clever stuff.

1 Like