-
Notifications
You must be signed in to change notification settings - Fork 290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace Handlebars with Tera #688
base: master
Are you sure you want to change the base?
Conversation
Thank you for your PR! I’ll test this over the weekend, but it looks good to me. I think the former style you used in the PR is fine for now. |
Given that we're holding off on Zolaification, is there a strong reason to switch to Tera? If it simplifies things I'm all for it though. |
Personally I prefer Tera templates because of their explicitness in template tags. Maybe it would also make them easier to understand for the new people and those who had experience with Jinja2/Django templates :) |
@Manishearth Yes, I think we want Tera for templating, it's much more powerful in ways that we care about. (For example; you can easily generate HTML from remote urls such as team data), and more DRY (you can set variables in the template, functions are just rust functions). I also personally prefer the syntax, I find things like blocks are harder to get wrong in tera than handlebars' sigil heavy syntax. I know docs.rs switched to using it awhile ago. None of this is in the current PR of course, it's a pretty straight 1-to-1 port. |
Seems okay to me, then. |
Oh, this is on the blog repo, I didn't realize :) |
Regardless of Zola, I also vastly prefer working with Tera compared to Handlebars. |
I really prefer how handlebars is more broadly known than terra, but at the same time, I don't do a ton of work in this codebase, so I don't think that should be a blocker. |
FWIW Tera's syntax is derived from templating languages like Jinja (Django/Python) and Twig (Symphony/PHP), which are incredibly popular in their respective languages. So I think whether one is more broad than the other really depends on your previous web experience and what you were already using before. |
f600d2b
to
862ddd4
Compare
Any updates on this? @XAMPPRocky |
@avrong Sorry for the delay, and I can't actually merge this anymore, so someone else will have to approve it. |
@avrong sorry we let this slide for so long. Do you have any interest in picking this back up? |
@rylev oh, yeah, will find a time to update this soon |
862ddd4
to
c4e3f49
Compare
Closes #599
I replaced the
handlebars
crate withtera
, adapted theGenerator
, and itsrender_template
method, converted themonth_name
filter and the templates.I'm not sure that all I've done is correct, so happy to make it better. The thing I'm not confident about is should the string concatenation be preferred in HTML args inside the templates: