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

Give the user the possibility to implement a 404 componenent #156

Closed
tychota opened this issue Feb 26, 2016 · 11 comments
Closed

Give the user the possibility to implement a 404 componenent #156

tychota opened this issue Feb 26, 2016 · 11 comments

Comments

@tychota
Copy link

tychota commented Feb 26, 2016

Related to #149 first comment
Directly related to #121

I'm having trouble implementing 404 componant. I realized it seems normal since router logic is split beetween gatsby build and actual versionable code.

Maybe, in long term switch gatsby build to be only the vital minimum, and put router logic directly in starter (or modules or whatever).

@gesposito
Copy link
Contributor

I'm also in the need of broader customizations #33

@KyleAMathews
Copy link
Contributor

@tychota there's a PR open to add this #121

It needs reworked a bit to support React Router 2.0 but I'm planning on merging it in tomorrow.

Its idea is you can add a 404.js file to your site and it'll be displayed when the router can't find a route.

How's that sound?

@KyleAMathews
Copy link
Contributor

@gesposito I reopened #33 which in retrospect shouldn't have been closed.

@KyleAMathews
Copy link
Contributor

@gesposito so let's continue the discussion there. I'd love to hear more about what you're building with Gatsby which would help guide the discussion of how to design multi-route pages.

@gesposito
Copy link
Contributor

I'm ok having less issues open, we can also continue here, I basically have a Ghost blog that I want to completely move to Gatsby. I'd like Gatbsy to be a static alternative to Ghost.

@tychota
Copy link
Author

tychota commented Feb 26, 2016

Sounds good but isn't that too much exception ?
I mean special file like this seems to much dark magic:

  • like postbuild.js
  • now a 404.js

Wha't about making gatsby executable simply generate à site that contains webpack config (so we can hack), idem for router ? Not sure it is really that crucial today but having logic split between gatsbyjs and actual blog make it hard to understand (not critic, just personal though / dev experience).

@KyleAMathews
Copy link
Contributor

I dunno, postbuild.js and 404.js seem pretty self-explanatory to me. If all you want is something that can generate a boilerplate that you then modify on, there's plenty of other projects that do this. The point of Gatsby is to eliminate setup and the need to think about much of the boilerplate/mundane details of setting up and maintaining a site so you can ignore all that and focus more on the content/structure/design.

@KyleAMathews
Copy link
Contributor

But yeah, a lot of the trickiness around designing Gatsby is where the boundary of control should be between Gatsby core / userland. You want to eliminate as much cognitive overhead as possible while retaining maximum flexibility.

@tychota
Copy link
Author

tychota commented Feb 26, 2016

Mmh. First sorry if my above comment feel rude, english is not my mother tongue.
Then thank you for explaining.

I wasn't thinking of a boilerplate, more a self-contained website, generated by gatsby command line the same way than rails create blog generate a new site. In this, you can have a folder for data with markdown (if you just want to write directly), a config folder, with default gatsbyconf (webpack, config.toml ect) file and some initializers (in config/initializers for instance) that allow to modify gatsby defaults functionnality in an easier way.

I think current gatsby is not that far form this but I don't know ... This is not that clear in my head for now, but as a developper expérience, I found it tricky to jump from core to user land. Maybe the fact that the readme don't mention it and thus I found that myself. Or a convention (like postbuild but for more of the logic).

I will definitivly try the 404.js and contribute if you want to some documentation (maybe somethink more exmple oriented, like redux doc), but as it is, even finding about postbuild wasn't an easy road.

I'm feeling it just miss a small think to be a perfect DX for both users in hurry and users that want to customize gatsby heavily. Still don't know what ..

@KyleAMathews
Copy link
Contributor

I think/hope documentation is the main DX problem right now. Like you said, getting RSS feed generation working was tough because it isn't documented anywhere right now. But if there were docs clearly explaining that + example code it wouldn't be so bad.

But things are still early and there's lots of rough edges to be smoothed out.

Definitely appreciate your feedback and help @tychota! :)

@KyleAMathews
Copy link
Contributor

This was fixed in #121

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