gatsby-starter icon indicating copy to clipboard operation
gatsby-starter copied to clipboard

Tags-Page.tsx template and blog.tsx page - corner case

Open i001962 opened this issue 7 years ago • 1 comments

I believe the Tag-Page template could should use an additional filter.

https://github.com/fabien0102/gatsby-starter/blob/df1edf08e0b420c91a9bc31cd281da4d9ef12be3/src/templates/tags-page.tsx#L9

Proposed to be:

  # Get tags
  tags: allMarkdownRemark(filter: {frontmatter: {draft: {ne: true}}, fileAbsolutePath: {regex: "/blog/"}}) {
    group(field: frontmatter___tags) {
      fieldValue
      totalCount
    }
  }

This is needed if you have a markdown file in a folder other than blog and that file has tags in the frontmatter. This could possibly be resolved for in gatsby-node.js too.

i001962 avatar Sep 13 '18 17:09 i001962

Also, the same type of filter could be added here

https://github.com/fabien0102/gatsby-starter/blob/df1edf08e0b420c91a9bc31cd281da4d9ef12be3/src/pages/blog.tsx#L103

fileAbsolutePath: {regex: "/blog/"}

i001962 avatar Sep 13 '18 17:09 i001962