Skip to content

Commit bdf2dfc

Browse files
authored
chore(docs): Update sourcing-from-json-or-yaml (#29488)
Updating how-to guide in section "Configure Gatsby pages" with new yaml.load function. Error says "Function yaml.safeLoad is removed in js-yaml 4. Use yaml. load instead, which is now safe by default."
1 parent 3ffa410 commit bdf2dfc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/docs/how-to/sourcing-data/sourcing-from-json-or-yaml.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ const fs = require("fs")
223223
const yaml = require("js-yaml")
224224
exports.createPages = ({ actions }) => {
225225
const { createPage } = actions
226-
const ymlDoc = yaml.safeLoad(fs.readFileSync("./content/index.yaml", "utf-8"))
226+
const ymlDoc = yaml.load(fs.readFileSync("./content/index.yaml", "utf-8"))
227227
ymlDoc.forEach(element => {
228228
createPage({
229229
path: element.path,

0 commit comments

Comments
 (0)