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

feat(gatsby-transformer-remark): allow generating relative path in tableOfContents #18543

Merged
merged 9 commits into from
Dec 10, 2019

Conversation

Austaras
Copy link
Contributor

@Austaras Austaras commented Oct 12, 2019

Description

Currently, gatsby generate absolute path in table of content which is not always necessary. After some digging I find the reason here but somehow the option for generate relative path is missing.

However, there is various ways to achieve this:

  1. add a relative flag. When true, generate relative path. This is the easiest solution but feels like somewhat wrong
  2. add a absolute flag. When true, generate absolute path. IMO this is the right way but it will introduce a break change
  3. generate relative path when pathToSlugField is empty. This will be a break change too.

@KyleAMathews What's your opinion?

Related Issues

Related to #4038, #19193

@Austaras Austaras marked this pull request as ready for review October 14, 2019 11:25
@Austaras Austaras requested a review from a team as a code owner October 14, 2019 11:25
@Austaras
Copy link
Contributor Author

the new commit is for route 3

@Austaras Austaras requested a review from stefanprobst October 22, 2019 07:56
@Austaras
Copy link
Contributor Author

may someone review this?

@Austaras Austaras requested a review from a team as a code owner October 29, 2019 13:12
@pieh pieh self-assigned this Oct 30, 2019
@Austaras Austaras added status: awaiting reviewer response A pull request that is currently awaiting a reviewer's response type: feature or enhancement labels Nov 22, 2019
@Austaras
Copy link
Contributor Author

any chance get this one merged?

@LekoArts
Copy link
Contributor

LekoArts commented Nov 26, 2019

Can you also add the new option to the GraphQL code snippet example?

@Austaras
Copy link
Contributor Author

added. Checks failure is due to a vulnerable dependency

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 @Austaras!

@pieh pieh changed the title feat(gatsby-transformer-remark): generate relative path in toc feat(gatsby-transformer-remark): allow generating relative path in tableOfContents Dec 10, 2019
@pieh pieh merged commit e65848c into master Dec 10, 2019
@delete-merged-branch delete-merged-branch bot deleted the toc branch December 10, 2019 12:47
@pieh
Copy link
Contributor

pieh commented Dec 10, 2019

Published in [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: awaiting reviewer response A pull request that is currently awaiting a reviewer's response
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants