Closed lucperkins closed 4 years ago
but I do occasionally miss the "scripting language"
I think an addition like this needs something bigger than to just satisfy a "craving".
We have Ace and Amber, but they compile to Go templates, so much easier to integrate. I don't know the Buffalo people good enough to understand if this is really great or not, but I have lots of questions:
So, it looks cool, and I hate to be the negative one. I expect a response in the line of "people could still use this for stuff without Hugo Pipes etc.", and you would probably be right, but even if we document those shortcomings, we would have plenty of support questions asking why "this and that fails".
@bep Those are 1000% valid concerns, so there's no harm in being the "negative one" here. I'll respond to your issues one by one:
In general, I concede that this is probably a "will not implement" at least for the time being, as I suspect that the necessary conditions aren't yet in place. But I'll keep tabs on it. Something like Mustache might be more realistic.
This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master
branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Over time, I've learned to like Go's native templating system but I do occasionally miss the "scripting language" feel of templating systems like Mustache and Liquid. It would be good if Hugo had a roughly analogous counterpart. This would ease the transition to Hugo for people coming from tools like Jekyll and Middleman and might even draw in some people like me who have become skilled with Go templating by accident.
Enter Plush, the templating system from the people who make the Buffalo web framework. It provides a templating syntax highly reminiscent—though not any kind of direct copy—of Liquid-style engines and even goes beyond them by providing things like inline functions. Here's an example (from Plush's
README
):The equivalent using Go templates (off the top of my head):
Personally, I've come to prefer the latter over time, but it took me years to get there. The former has the potential to draw in new users and open up broad new horizons.
If I could get a few pointers on how to accomplish this I'm happy to do the work myself. I've poked around in the
tpl
directory but I'm still not quite sure how to make it happen. It's pretty clear how an HTML engine à la Ace and Amber work but the pre-HTML engine is less clear.