I know, that I can use something like this:
- site.posts.each(function(article){
h2.title= article.title
p.article= arcticle.content
- })
I feel this way wrong, because Jade has its own native construction for looping over something, but it seems not working:
each article in site.posts
h2.title= article.title
p.article= arcticle.content
You need to do site.posts.toArray()
and the loop will work fine. This had me confused for a while too and the answer on github is mostly in Chinese.
https://github.com/tommy351/hexo/issues/321
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With