In case we've got a collection of items in our site data, we might very well want to generate some pages using that collection. A site that displays blog posts, for instance, would probably want an individual page generated for each post in the collection of posts.
In this recipe we'll be continuing work on the project from the Creating and using a site layout recipe in this chapter. Be sure to refer to it if you are not yet familiar with it's content. Before we start we should also make sure that the site builder and server are running. If they aren't yet running they can be started using the grunt server
command.
The following steps take us through creating a data file that contains a collection of our blog posts, and configuring our project to generate pages using that collection.
Let's start with creating the collection data that we'll be generating pages from. We can do this by creating a file called
posts.yml
in thesrc...