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

Added support for NotFoundRoute, Redirect, Pagination, Tags #36

Closed
wants to merge 1 commit into from
Closed

Added support for NotFoundRoute, Redirect, Pagination, Tags #36

wants to merge 1 commit into from

Conversation

gesposito
Copy link
Contributor

Fixes #33.

This is a preliminary revision, looking for code review, it's a litte verbose.

v0.13.x API

It adds
<NotFoundRoute handler={_404}/> for root _template.

<Route path="/tag/:tagId" component={_tag}/> for root _template.

<Route path="/page/:pageId" component={_pagination}/> for root _template and every child _template.

<Redirect from="some/where" to="somewhere/else" /> for every page that has the redirect metadata.

Inside _404, _tag, _pagination we can have appropriates Component handlers for those Routes.
Since they should be optional and the missing _404, _tag, _pagination templates could crash gatsby I added the optional configurations (booleans):
notFound
pagination
tags
to enable them (is there a better way?).

Notes

Since we could #32 I can wait for the branch and make the final PR there.

@KyleAMathews
Copy link
Contributor

I don't think 404/tag/category/pagination/etc. belong in Gatsby core as there's dozens of possible extensions like this and I don't want there to be special syntax for each one. I'm a big fan of having a small core with a thoughtful lifecycle/plugin architecture that makes it trivial to add extensions like easy tagging/pagination support.

I have a page of notes on requirements for a plugin system. Let me find some time the next few days to get that posted.

That being said, until there is a plugin system, adding 404 support now would be great. Any real site needs that (like mine). If you want to close this PR and add a new one with the 404 support, I'll merge that right away and once a plugin system lands, we'll migrate 404 support into a gatsby-plugin-404.

Thoughts?

@gesposito gesposito closed this Sep 21, 2015
ChristopherBiscardi pushed a commit to ChristopherBiscardi/gatsby that referenced this pull request Jun 27, 2019
* set up test content

* backwards compatibility for defaultLayout

* use source default layout and fallback to default
KyleAMathews added a commit that referenced this pull request Mar 27, 2020
…it for it to be accepted (#36)

It's often a good idea to prototype an implementation of an RFC while it's being deliberated as many designs can't be created without trying out the code.
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 this pull request may close these issues.

2 participants