-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Use nunjucks-compatible syntax & operator #1068
Conversation
Maybe need a new label for code style change. |
Let's up this set on v8.x? I think no need on v7. |
https://github.com/popomore/nunjucks-vs-swig
|
See also: hexojs/hexo#2903 |
Need to rename *.swig on *njk also, I think. |
Yes, we could do this after Hexo drops swig support. The syntax of these two template engines is similar, except for some minor differences: cd layout
find . -name "*.swig" -exec rename 's/\.swig$/.njk/' '{}' \; |
@ivan-nginx @1v9 I tried to use
I have no idea why So, this PR works fine, but another PR is needed to handle the |
Hexo hasn't toally switched to nunjucks, but tag plugin used nunjucks to render. |
Yes, so you have to install the plugin first: hexo-renderer-njucks |
These nunjucks plugins maintenance is not stable enough, so just wait hexojs/hexo#2903 finished and merged and more... |
There are 3 or maybe more nunjucks plugins, not all in public Hexo directory.
|
In fact none is in public Hexo directory. They are all 3rd-party plugin. And I choose the only one that still maintained... |
BTW, mb we can create own nunjucks plugin and make him internal in scripts dir? |
Which plugin u choose? |
This one: https://github.com/AlynxZhou/hexo-renderer-nunjucks
|
yes, we can just put it in the |
So, we must find all possible plugins and create from them the best one. |
Also, we can no rename swig extension; we can just add swig to nunjucks renderer, that's all. |
We can't migrate to njk unless we clearly understands the problem |
* Replace && with and * Replace || with or * Replace ! with not * Use ES6 includes method
Swig-template supports
|| && or and
nunjucks only supports
or and
mozilla/nunjucks#622