Collections

Pages can be associated with a collection by defining meta.collection:

export const meta = {
title: 'My article',
collection: 'posts',
date: '2020-01-30'
}

The collection specified in tropical.feedCollection in package.json will be published to the JSON Feed.

If your pages also define a valid meta.date the collection will be sorted by date.

Using collections

Each page receives a collections prop which can be used to display a collection (e.g. list all your blog posts):

props.collections.posts.map(({ meta, urlPath }) => <a href={urlPath}>{meta.title} - {meta.date}</a>

Next: Components