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

Fix sub section links for /docs/gatsby-config #9290

Merged
merged 1 commit into from
Oct 22, 2018
Merged

Fix sub section links for /docs/gatsby-config #9290

merged 1 commit into from
Oct 22, 2018

Conversation

siddharthkp
Copy link
Contributor

@siddharthkp siddharthkp commented Oct 22, 2018

Bug:

The links for configuration options on the Gatsby Config page don't scroll to the right section because they have incorrect id

URL in link: https://www.gatsbyjs.org/docs/gatsby-config/#pathPrefix
Actual link: https://www.gatsbyjs.org/docs/gatsby-config/#pathprefix

Notice the lowercased part at the end. The actual links are generated by gatsby-remark-autolink-headers.

Fix

In this pull request, I've changed the url in links to be lowercase as well. (This is what the react docs do as well)

Alternate Fix

The problem with this fix is that it's not consistent with the older version of the docs which use camelCased links. Example: https://www.gatsbyjs.org/docs/actions/#addThirdPartySchema

gatsby-remark-autolink-headers uses github-slugger to create the slugs for markdown headers - which supports camelCased slugs as well by passing an addition argument (test case: github-slugger/index#13)

This will have to be opt-in option for gatsby-remark-autolink-headers so that applications already using it don't break.

Let me know what you think

@siddharthkp siddharthkp requested a review from a team October 22, 2018 11:02
Copy link
Contributor

@pieh pieh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @siddharthkp!

@pieh pieh merged commit 2174e5f into gatsbyjs:master Oct 22, 2018
@gatsbot
Copy link

gatsbot bot commented Oct 22, 2018

Holy buckets, @siddharthkp — we just merged your PR to Gatsby! 💪💜

Gatsby is built by awesome people like you. Let us say “thanks” in two ways:

  1. We’d like to send you some Gatsby swag. As a token of our appreciation, you can go to the Gatsby Swag Store and log in with your GitHub account to get a coupon code good for one free piece of swag. (Currently we’ve got a couple t-shirts available, plus some socks that are really razzing our berries right now.)
  2. We just invited you to join the Gatsby organization on GitHub. This will add you to our team of maintainers. Accept the invite by visiting https://github.com/orgs/gatsbyjs/invitation. By joining the team, you’ll be able to label issues, review pull requests, and merge approved pull requests.

If there’s anything we can do to help, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’.

Thanks again!

gpetrioli pushed a commit to gpetrioli/gatsby that referenced this pull request Jan 22, 2019
### Bug:

The links for configuration options on the [Gatsby Config](https://www.gatsbyjs.org/docs/gatsby-config) page don't scroll to the right section because they have incorrect id 

URL in link: https://www.gatsbyjs.org/docs/gatsby-config/#pathPrefix
Actual link: https://www.gatsbyjs.org/docs/gatsby-config/#pathprefix

Notice the lowercased part at the end. The actual links are generated by [gatsby-remark-autolink-headers](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-remark-autolink-headers/src/index.js#L19).

### Fix

In this pull request, I've changed the url in links to be lowercase as well. (This is what the react docs do as well)

### Alternate Fix

The problem with this fix is that it's not consistent with the older version of the docs which use camelCased links. Example: https://www.gatsbyjs.org/docs/actions/#addThirdPartySchema

`gatsby-remark-autolink-headers` uses `github-slugger` to create the slugs for markdown headers - which supports camelCased slugs as well by passing an addition argument (test case: [github-slugger/index#13](https://github.com/Flet/github-slugger/blob/master/test/index.js#L13))

This will have to be opt-in option for `gatsby-remark-autolink-headers` so that applications already using it don't break.

Let me know what you think
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.

None yet

2 participants