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
migrate gatsby 1.0 to 2.0 #94
migrate gatsby 1.0 to 2.0 #94
Conversation
if (index === 0) { | ||
next.slug = `/docs/${slugArray[2]}/${chapter.items[index + 1].id}/`; | ||
next.title = chapter.items[index + 1].title; | ||
} else if (slugArray[3] === item.id) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return early instead of using an else if
?
if (chapter.items.length - 1 !== index) { | ||
next.slug = `/docs/${slugArray[2]}/${chapter.items[index + 1].id}/`; | ||
next.title = chapter.items[index + 1].title; | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return early instead of using else
?
createNodeField({ | ||
node, | ||
name: 'redirect', | ||
value: nodePath, | ||
name: `slug`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name: `slug`, | |
name: 'slug', |
{this.props.preBodyComponents} | ||
<div key={'body'} id="___gatsby" dangerouslySetInnerHTML={{ __html: this.props.body }} /> | ||
<div key={`body`} id="___gatsby" dangerouslySetInnerHTML={{ __html: this.props.body }} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<div key={`body`} id="___gatsby" dangerouslySetInnerHTML={{ __html: this.props.body }} /> | |
<div key="body" id="___gatsby" dangerouslySetInnerHTML={{ __html: this.props.body }} /> |
There is one last issue, there is no menu animation on mobile when switching pages (no close menu animation to be precise). This is a normal as of Gatsby 2.0 : https://www.gatsbyjs.org/docs/layout-components/#how-to-prevent-layout-components-from-unmounting There is 2 solutions :
My suggestion, as this issue is minor (and don't have the time to finish now), is to fix it in a separate issue later. |
Thank you very much @Fabious! Good work. |
Migration to Gatsby 2.0
Updated the breaking changes,
Bumped others deps too,
Refactor some code,
And fixed some wrong code (especially previous and next page on the docs)
If someone can test this feature at least locally i would be grateful, as i had to do a lot of changes ! :)
Need to be fixed