Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

404 from blog tag card if tag has more than one word when generated #62

Open
i001962 opened this issue Apr 30, 2018 · 6 comments
Open

Comments

@i001962
Copy link
Collaborator

i001962 commented Apr 30, 2018

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.

@sielay
Copy link
Collaborator

sielay commented May 17, 2018

It's how the link is created in TagsCard. It should use kebabCase

const tagLink = isActive ? `/blog` : `/blog/tags/${kebabCase(tag.fieldValue)}/`;

@fabien0102
Copy link
Owner

@sielay can you made a PR for this ?

@sielay
Copy link
Collaborator

sielay commented May 17, 2018

Will try to do this week. Just bit busy :P

@i001962
Copy link
Collaborator Author

i001962 commented Aug 31, 2018

I believe this also needs to be included in that PR.
import { kebabCase } from "lodash";

@sielay
Copy link
Collaborator

sielay commented Sep 3, 2018

Well. OFC @i001962 . Should you do one? I had no time even for such tiny one.

@i001962
Copy link
Collaborator Author

i001962 commented Sep 3, 2018

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants