Skip to content

Instantly share code, notes, and snippets.

@jescalan
Forked from stefanoverna/interface-example.js
Created April 27, 2017 16:48
Show Gist options
  • Save jescalan/a39e9c7dd3dd8168d90c7e65fc1f8172 to your computer and use it in GitHub Desktop.
Save jescalan/a39e9c7dd3dd8168d90c7e65fc1f8172 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