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

url / issue #364

Closed
konsumer opened this issue Jul 22, 2016 · 4 comments · Fixed by #378
Closed

url / issue #364

konsumer opened this issue Jul 22, 2016 · 4 comments · Fixed by #378

Comments

@konsumer
Copy link
Contributor

I have 2 demo sites my blog and this starter demo. Both work great local.

Running with the same code, my blog still needs a trailing / on links to work (on gh_pages.) On the starter demo, it adds them. The only real difference I can tell is that on my blog I put everything directly in pages/articles/(pages/articles/article.md not pages/articles/article/index.md) and there is a config.linkPrefix of "", but the starter demo has them all in the root with a config.linkPrefix of "/gatsby-starter-drunkenblog".

I think maybe I need to check for a trailing-slash in prefixLink in gatsby-helpers.

@KyleAMathews
Copy link
Contributor

So the problem is page.path doesn't have a trailing slash at times? https://github.com/konsumer/gatsby-starter-drunkenblog/blob/master/pages/index.js#L38

@konsumer
Copy link
Contributor Author

Ah dood! I just need to edit the front-matter paths! thanks.

@KyleAMathews
Copy link
Contributor

Well... this is actually pretty weird. The page.path should always have a trailing slash. We should investigate why not. This isn't something a site should need to check for.

@KyleAMathews KyleAMathews reopened this Jul 22, 2016
@konsumer
Copy link
Contributor Author

Yeh, that makes sense. I understand that articles/article_name/ doesn't exactly map to articles/article_name.md as well as articles/article_name/index.md, but maybe it should be handled at a higher level than the path-fixer (like in the router) so it will work intuitively, out-of-the-box.

For just fixing the path front-matter on my blog, here is the script I threw together.

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

Successfully merging a pull request may close this issue.

2 participants