-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
File name case issue (avoid caps and CamelCase) #451
Comments
Is there not use cases for having upper-case urls? It seems like it'd be confusing to modify URLs like this e.g. what if someone wanted a handful of URLs to be uppercase or even if they had two urls with the same letters just with different casing. I'd suggest just using the |
I feel like upper-case URLs are probably a bad idea anyway? I can't really think of a use case where you'd want to have both |
As far as the node community is concerned, The former is preferred for consistent imports: import 'some-module/sub-module';
// vs
import 'some-module/SubModule'; Furthermore, consistently using |
Reducing the number of concepts that make up a framework is a useful design principle. Right now there's one rule — the JS filename becomes it's URL. If we make this change @SachaG there'd be two rules, (filename) => URL unless filename is capitalized. Since it's easy enough to programmatically add this extra rule I'd say let's just keep things as they are. |
Well I guess one way makes for a simpler codebase and a more complex experience, and the other way is the opposite. It's all about trade-offs… :) |
How does one easily remove case sensitivity from Gatsby URL processing? To me having overlapping (but with different casings) URLs is an abomination, as is needlessly sending the user to a 404 page ... when a perfectly valid page (just with a different casing) is sitting there waiting for them. So how can I avoid both of those nightmare scenarios and still use Gatsby? EDIT: Related Stack Overflow Question: https://stackoverflow.com/questions/62559366/gatsby-how-can-i-have-case-insensitive-dynamic-urls |
I'm used to naming React components using CamelCase (
MyComponent.js
) but I just realized that although this works fine locally, it doesn't work with GitHub Pages routing.I would suggest Gatsby just normalize every name to lowercase at build time, so a
MyComponent.js
page would become amycomponent/index.html
file instead of the currentMyComponent/index.html
.The text was updated successfully, but these errors were encountered: