sintaxi / harp

Static Web Server/Generator/Bundler
http://harpjs.com
5k stars 346 forks source link

storing _data in an array #615

Closed allergeek closed 4 years ago

allergeek commented 7 years ago

Hi, my blog runs on Harp and I'd love to have a list of posts. The post content is grouped into themes though, for example:

/post /nutrition post-title.jade /running post-title.jade ...

I followed an example found at http://harpjs.com/recipes/blog-posts-list – and it works well with a variable holding a single value, but not with an array.

Do you think this is possible to accomplish? Thank you!

postsEN = [];
groot = [];
groot = ["public.post.nutrition._data","public.post.neuroscience._data"];
for (var post in groot) {
  postsEN.push(groot[post].title);
};