-
Notifications
You must be signed in to change notification settings - Fork 11
/
gatsby-node.js
41 lines (40 loc) · 1020 Bytes
/
gatsby-node.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const createPaginatedPages = require('gatsby-paginate')
exports.createPages = ({ graphql, boundActionCreators }) => {
const { createPage } = boundActionCreators
return new Promise((resolve, reject) => {
graphql(`
{
site {
siteMetadata {
title
}
}
posts: allMarkdownRemark(
sort: { order: DESC, fields: [frontmatter___date] }
filter: { fileAbsolutePath: { regex: "/(slides)/.*.md$/" } }
) {
totalCount
edges {
node {
id
html
frontmatter {
date(formatString: "DD.MM.YYYY.")
title
}
}
}
}
}
`).then(result => {
createPaginatedPages({
edges: result.data.posts.edges,
createPage: createPage,
pageTemplate: 'src/templates/slides/index.js',
pathPrefix: 'slides',
pageLength: 3
})
resolve()
})
})
}