From fb5f9c89fc6f63e4732468b4152f59a2b578b586 Mon Sep 17 00:00:00 2001 From: alxshelepenok Date: Mon, 12 Nov 2018 20:38:36 +0300 Subject: [PATCH] Rename slug field --- content/pages/about/index.md | 2 +- content/pages/contact/index.md | 4 ++-- gatsby/on-create-node.js | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/content/pages/about/index.md b/content/pages/about/index.md index fbf0a1e..b2ee9d7 100644 --- a/content/pages/about/index.md +++ b/content/pages/about/index.md @@ -1,7 +1,7 @@ --- title: "About me" -slug: "/about" template: "page" +slug: "/about" --- Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. diff --git a/content/pages/contact/index.md b/content/pages/contact/index.md index b08e6db..666fdbc 100644 --- a/content/pages/contact/index.md +++ b/content/pages/contact/index.md @@ -1,7 +1,7 @@ --- title: "Contact me" -slug: "/contact" template: "page" +slug: "/contacts" --- Morbi in sem quis dui placerat ornare. Pellentesque odio nisi, euismod in, pharetra a, ultricies in, diam. Sed arcu. Cras consequat. @@ -28,4 +28,4 @@ Pellentesque fermentum dolor. Aliquam quam lectus, facilisis auctor, ultrices ut #### Header Level 4 -Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. \ No newline at end of file +Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. \ No newline at end of file diff --git a/gatsby/on-create-node.js b/gatsby/on-create-node.js index 895bcde..a51d00c 100644 --- a/gatsby/on-create-node.js +++ b/gatsby/on-create-node.js @@ -10,7 +10,8 @@ const onCreateNode = ({ node, actions, getNode }) => { fmImagesToRelative(node); if (node.internal.type === 'MarkdownRemark') { - if (typeof node.frontmatter.path !== 'undefined') { + console.log(node.frontmatter); + if (typeof node.frontmatter.slug !== 'undefined') { createNodeField({ node, name: 'slug',