New
import Filer from '@cloudcannon/filer';
const filer = new Filer({ path: 'content' });
Old
await getCollectionSlugs('posts');
New
(await filer.listItemSlugs('posts')).map((slug) => ({ params: { slug } }));
Old
getCollection('posts');
getCollection('posts', { excerpt: true, sortKey: 'date' });
New
filer.getItems('posts');
filer.getItems('posts', { excerpt: true, sortKey: 'date' });
Old
// Assumes slug ends with .md
getCollectionItem('posts', 'my-example-post');
getCollectionItem('posts', 'my-example-post', { excerpt: true });
New
filer.getItem('my-example-post.md', { folder: 'posts' });
const item = filer.getItem('my-example-post.md', {
folder: 'posts',
excerpt: true
});
const oldItem = { // The return result has changed - front matter now in data
...item.data,
slug: item.slug
};