How to loop over posts in Hexo with native Jade construction
node.js, pug
Solution
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
Problem
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 ```