From 0a9ed9b745864ecc25d03e70273883d005578646 Mon Sep 17 00:00:00 2001 From: "@s.roertgen" Date: Thu, 9 Nov 2023 12:16:42 +0100 Subject: [PATCH] Add `tag/` to path to avoid potential path conflicts --- gatsby-node.js | 2 +- src/components/tag.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gatsby-node.js b/gatsby-node.js index 8590ac2..a70abdc 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -72,7 +72,7 @@ exports.createPages = async ({ graphql, actions, reporter }) => { if (tags.length > 0) { tags.forEach(tag => { createPage({ - path: tag, + path: "tag/" + tag, component: blogIndex, context: { posts: posts.filter(p => p.frontmatter.tags.includes(tag)), diff --git a/src/components/tag.js b/src/components/tag.js index feb11e9..e660fa9 100644 --- a/src/components/tag.js +++ b/src/components/tag.js @@ -4,7 +4,7 @@ import { stringToColor } from "../common" export const Tag = ({ tag }) => { return ( - + {tag} )