From 17a0d52f8e4a77feab5457efe1bad9e4de2d78d8 Mon Sep 17 00:00:00 2001 From: Stephan Weinhold Date: Mon, 9 Nov 2020 14:35:58 +0100 Subject: [PATCH] chore(docs): Add required `path` import to modifying-pages doc (#27883) Co-authored-by: Lennart --- docs/docs/creating-and-modifying-pages.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/docs/creating-and-modifying-pages.md b/docs/docs/creating-and-modifying-pages.md index ed694a042cd7b..ca71ddfc5fe13 100644 --- a/docs/docs/creating-and-modifying-pages.md +++ b/docs/docs/creating-and-modifying-pages.md @@ -54,6 +54,8 @@ This example assumes that each markdown page has a `path` set in the frontmatter of the markdown file. ```javascript:title=gatsby-node.js +const path = require("path") + // Implement the Gatsby API “createPages”. This is called once the // data layer is bootstrapped to let plugins create pages from data. exports.createPages = async ({ graphql, actions, reporter }) => { @@ -120,6 +122,7 @@ In the initial approach you have seen how the `gatsby-node.js` file would have a Using the `id` as an access point to query for other properties in the template is the default approach. However, suppose you had a list of products with properties you would like to query for. Handling the query entirely from `gatsby-node.js` would result in the query looking like this: ```javascript:title=gatsby-node.js +const path = require("path") exports.createPages = async ({ graphql, actions }) => { const { createPage } = actions;