gatsby-starter
gatsby-starter copied to clipboard
404 from blog tag card if tag has more than one word when generated
npm run generate blog post
If a tag name has a space say between two words e.g. "Probability Management" the tag card link does not include the necessary hyphen but instead tries to go to /blog/tags/Probability%20Management/ instead of /blog/tags/Probability-Management/ which was created.
No time today to hunt down a possible fix but wanted to note it here. The workaround is to hyphenate when using plop generator.
It's how the link is created in TagsCard. It should use kebabCase
const tagLink = isActive ? `/blog` : `/blog/tags/${kebabCase(tag.fieldValue)}/`;
@sielay can you made a PR for this ?
Will try to do this week. Just bit busy :P
I believe this also needs to be included in that PR. import { kebabCase } from "lodash";
Well. OFC @i001962 . Should you do one? I had no time even for such tiny one.
@sielay I’ll do one once I figure out all the tests. I laugh a little bit when you say ofc as it wasn’t obvious to a noob like me and may not be to others who are new to react.