Skip to content

Commit

Permalink
Add tag/ to path to avoid potential path conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
sroertgen committed Nov 9, 2023
1 parent 2a02605 commit 0a9ed9b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down
2 changes: 1 addition & 1 deletion src/components/tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { stringToColor } from "../common"

export const Tag = ({ tag }) => {
return (
<Link to={"/" + tag} style={{ backgroundColor: stringToColor(tag) }} className="chip">
<Link to={"/tag/" + tag} style={{ backgroundColor: stringToColor(tag) }} className="chip">
{tag}
</Link>
)
Expand Down

0 comments on commit 0a9ed9b

Please sign in to comment.