v4iv / gatsby-starter-business

Gatsby Business Website Starter

Home Page:https://gatsby-starter-business.netlify.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Slug in blog article template

Qtaza opened this issue · comments

commented

Hi!

I don't understand, why blog article template constains slug fileld. This slug is not used anything.

I see that 'gatsby-node.js' has this fragment:

    postsAndPages.forEach(edge => {
      const id = edge.node.id
      createPage({
        path: edge.node.fields.slug,
        tags: edge.node.frontmatter.tags,
        component: path.resolve(
          `src/templates/${String(edge.node.frontmatter.templateKey)}.js`
        ),
        // additional data can be passed via context
        context: {
          id,
        },
      })
    })

4 line using edge.node.fields.slug from fields array.
fields.slug return file-name, not the slug field.

Please give me more description of this slug field.

@Qtaza it's something that I was planning to add but haven't yet gotten around to implementing, will be working on it soon.