Skip to content

Commit

Permalink
Fix DatoCMS benchmarks (#22761)
Browse files Browse the repository at this point in the history
* Fix DatoCMS benchmarks

* Update double quotes to backticks
  • Loading branch information
duffn authored Apr 2, 2020
1 parent a6f5dc3 commit 62cba61
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions benchmarks/source-datocms/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ module.exports = {
path: `${__dirname}/src/pages/`,
},
},
{
{
resolve: `gatsby-source-datocms`,
options: {
apiToken: process.env.DATOCMS_API_TOKEN,
previewMode: false,
disableLiveReload: false,
apiUrl: 'https://site-api.datocms.com',
apiUrl: `https://site-api.datocms.com`,
},
},
],
Expand Down
10 changes: 5 additions & 5 deletions benchmarks/source-datocms/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ const kebabCase = require(`lodash.kebabcase`)
exports.onCreateNode = ({ actions, node }) => {
const { createNodeField } = actions

if (node.internal.type === 'node__article') {
createNodeField({ node, name: "slug", value: kebabCase(node.title) })
if (node.internal.type === `node__article`) {
createNodeField({ node, name: `slug`, value: kebabCase(node.title) })
}
}

Expand All @@ -16,7 +16,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
articles: allDatoCmsArticle {
nodes {
id
path
slug
}
}
}
Expand All @@ -28,11 +28,11 @@ exports.createPages = async ({ actions, graphql, reporter }) => {

result.data.articles.nodes.map(article => {
createPage({
path: article.path,
path: article.slug,
component: require.resolve(`./src/templates/article.js`),
context: {
id: article.id,
}
},
})
})
}
4 changes: 2 additions & 2 deletions benchmarks/source-datocms/src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const Index = ({ data }) => {
<ul>
{data.articles.nodes.map(article => (
<li>
<Link to={article.path}>{article.title}</Link>
<Link to={article.slug}>{article.title}</Link>
</li>
))}
</ul>
Expand All @@ -29,7 +29,7 @@ export const query = graphql`
articles: allDatoCmsArticle {
nodes {
title
path
slug
}
}
}
Expand Down

0 comments on commit 62cba61

Please sign in to comment.