If one wants a view for the whole page, then using a programming language with a good support for embedding strings will be a better solution as it avoids the need to learn one more language.
DSLs have their place. arguably we have too few of them. we always use a general language. which is good, because it's general, sometimes great at a few things, but usually very awkwardly at most of the things.
Alan Kay (and his teammates during the STEPS project at VPRI) spent years and years thinking/experimenting with this, here's the final report from 2016: https://news.ycombinator.com/item?id=11686325
"The big breakthrough is making it easy to create new DSLs for any situation."
a simple template language is composed in its entirety of like 3 separate pieces of syntax, it should be something you can learn in 5 minutes. Like I said in my original post, the point of it is to limit what you can do, so that templates stay templates, and code stays code. If there's a learning curve to your template language, you've already lost.
The template system is somewhat like the type system in that it provides you guarantees. The templates cannot mutate any data or pull anything in that you didn't provide to it. You can be 100% sure that no one did a cute little temporary hack modifying the data inside the template somewhere, pulled in some external data real quick on a friday afternoon or did anything else that doesn't belong in the template. That's the advantage over just using a regular programming language.
Alan Kay (and his teammates during the STEPS project at VPRI) spent years and years thinking/experimenting with this, here's the final report from 2016: https://news.ycombinator.com/item?id=11686325
"The big breakthrough is making it easy to create new DSLs for any situation."