Skip to content

Instantly share code, notes, and snippets.

@stefanoverna
Created April 27, 2017 16:36
Show Gist options
  • Save stefanoverna/d436e19f7cff1c66c53090b3d5ee7825 to your computer and use it in GitHub Desktop.
Save stefanoverna/d436e19f7cff1c66c53090b3d5ee7825 to your computer and use it in GitHub Desktop.
new SpikeDatoCMS({
addDataTo: locals,
token: 'xxx',
templates: [
{
collection: (dato) => dato.blogPosts,
path: 'templates/post.html',
output: (post) => { return `posts/${post.slug}.html` }
}
]
})
// this would expose "loader.itemsRepo" as "dato" to every template
// and generate N detail pages, one for each blog post
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment