intial eslint pre-commit setup
This commit is contained in:
+9
-12
@@ -1,14 +1,11 @@
|
||||
exports.createPages = async ({ actions, graphql, reporter }) => {
|
||||
const { createPage } = actions
|
||||
const { createPage } = actions;
|
||||
|
||||
const blogPostTemplate = require.resolve(`./src/templates/blogTemplate.js`)
|
||||
const blogPostTemplate = require.resolve(`./src/templates/blogTemplate.js`);
|
||||
|
||||
const result = await graphql(`
|
||||
{
|
||||
allMarkdownRemark(
|
||||
sort: { order: DESC, fields: [frontmatter___date] }
|
||||
limit: 1000
|
||||
) {
|
||||
allMarkdownRemark(sort: { order: DESC, fields: [frontmatter___date] }, limit: 1000) {
|
||||
edges {
|
||||
node {
|
||||
frontmatter {
|
||||
@@ -18,12 +15,12 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
`)
|
||||
`);
|
||||
|
||||
// Handle errors
|
||||
if (result.errors) {
|
||||
reporter.panicOnBuild(`Error while running GraphQL query.`)
|
||||
return
|
||||
reporter.panicOnBuild(`Error while running GraphQL query.`);
|
||||
return;
|
||||
}
|
||||
|
||||
result.data.allMarkdownRemark.edges.forEach(({ node }) => {
|
||||
@@ -34,6 +31,6 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
|
||||
// additional data can be passed via context
|
||||
slug: node.frontmatter.slug,
|
||||
},
|
||||
})
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user