Commit 1ef2954e authored by Seth A Johnson's avatar Seth A Johnson
Browse files

changin how paths work in generated pages

parent 432c7483
...@@ -14,7 +14,6 @@ exports.createPages = async ({ actions, graphql, reporter }) => { ...@@ -14,7 +14,6 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
slug slug
} }
frontmatter { frontmatter {
path
templateKey templateKey
} }
} }
...@@ -39,6 +38,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => { ...@@ -39,6 +38,7 @@ exports.createPages = async ({ actions, graphql, reporter }) => {
pages.forEach(edge => { pages.forEach(edge => {
const pathName = edge.node.frontmatter.path || edge.node.fields.slug; const pathName = edge.node.frontmatter.path || edge.node.fields.slug;
console.log(pathName);
const component = path.resolve(`src/templates/${String(edge.node.frontmatter.templateKey)}.js`); const component = path.resolve(`src/templates/${String(edge.node.frontmatter.templateKey)}.js`);
const id = edge.node.id const id = edge.node.id
createPage({ createPage({
......
--- ---
templateKey: info-page templateKey: info-page
path: /info
title: The Info Page title: The Info Page
--- ---
# info of stuff # info of stuff
......
...@@ -13,7 +13,7 @@ collections: ...@@ -13,7 +13,7 @@ collections:
label: News label: News
folder: src/content/news folder: src/content/news
create: true create: true
slug: "news/{{year}}-{{month}}-{{day}}-{{slug}}" slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
fields: fields:
- { name: templateKey, label: "Template Key", widget: hidden, default: news } - { name: templateKey, label: "Template Key", widget: hidden, default: news }
- { name: title, label: Title } - { name: title, label: Title }
...@@ -24,7 +24,7 @@ collections: ...@@ -24,7 +24,7 @@ collections:
label: Events label: Events
folder: src/content/events folder: src/content/events
create: true create: true
slug: "events/{{year}}-{{month}}-{{day}}-{{slug}}" slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
fields: fields:
- { name: templateKey, label: "Template Key", widget: hidden, default: event } - { name: templateKey, label: "Template Key", widget: hidden, default: event }
- { name: title, label: Title } - { name: title, label: Title }
...@@ -35,7 +35,7 @@ collections: ...@@ -35,7 +35,7 @@ collections:
label: Books label: Books
folder: src/content/books folder: src/content/books
create: true create: true
slug: "books/{{authorLastname}}-{{title}}" slug: "{{authorLastname}}-{{title}}"
fields: fields:
- { name: templateKey, label: "Template Key", widget: hidden, default: book } - { name: templateKey, label: "Template Key", widget: hidden, default: book }
- { name: title, label: Title } - { name: title, label: Title }
...@@ -49,28 +49,25 @@ collections: ...@@ -49,28 +49,25 @@ collections:
- name: pages - name: pages
label: Pages label: Pages
files: files:
- file: "src/content/pages/about.md" - file: "src/content/about.md"
name: about name: about
label: About label: About
fields: fields:
- { name: templateKey, label: "Template Key", widget: hidden, default: about-page } - { name: templateKey, label: "Template Key", widget: hidden, default: about-page }
- { name: path, label: Path, widget: hidden, default: "/about" }
- { name: title, label: About } - { name: title, label: About }
- { name: body, label: Body, widget: markdown } - { name: body, label: Body, widget: markdown }
- file: "src/content/pages/info.md" - file: "src/content/info.md"
name: info name: info
label: Info label: Info
fields: fields:
- { name: templateKey, label: "Template Key", widget: hidden, default: info-page } - { name: templateKey, label: "Template Key", widget: hidden, default: info-page }
- { name: path, label: Path, widget: hidden, default: "/info" }
- { name: title, label: Info } - { name: title, label: Info }
- { name: body, label: Body, widget: markdown } - { name: body, label: Body, widget: markdown }
- file: "src/content/pages/impact.md" - file: "src/content/impact.md"
name: impact name: impact
label: Impact label: Impact
fields: fields:
- { name: templateKey, label: "Template Key", widget: hidden, default: impact-page } - { name: templateKey, label: "Template Key", widget: hidden, default: impact-page }
- { name: path, label: Path, widget: hidden, default: "/impact" }
- { name: title, label: Impact } - { name: title, label: Impact }
- { name: readershipMapDescription, label: "Readership Map Description", widget: markdown } - { name: readershipMapDescription, label: "Readership Map Description", widget: markdown }
- { name: googleDataStudioDescription, label: "Google Data Studio Description", widget: markdown } - { name: googleDataStudioDescription, label: "Google Data Studio Description", widget: markdown }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment