Closed veksen closed 4 years ago
This is necessary to keep the Table of contents in line with the headers. However, the anchors from the generated TOC (which are generated from frontmatter html/headings) do not match the auto headers from gatsby-remark-auto-headers.
gatsby-remark-auto-headers
gatsby-remark-auto-headers is a little problematic at the moment as it produces some invalid IDs (for example: "1. Get started" -> #1-get-started), and also doesn't match the way we generate anchors from headers, using Lodash kebabCase: https://github.com/the-programmers-hangout/website/blob/34047cc05cd5e7c5c4e5335e4b13e0c09ab0a5f9/src/utils/index.ts#L155
#1-get-started
kebabCase
One solution would be to fork or use an internally modified version of the plugin.
See how lodash.com/gatsby does it: https://github.com/lodash/lodash.com/tree/gatsby/plugins/gatsby-source-lodash
blocks #252
This is necessary to keep the Table of contents in line with the headers. However, the anchors from the generated TOC (which are generated from frontmatter html/headings) do not match the auto headers from
gatsby-remark-auto-headers
.gatsby-remark-auto-headers
is a little problematic at the moment as it produces some invalid IDs (for example: "1. Get started" ->#1-get-started
), and also doesn't match the way we generate anchors from headers, using LodashkebabCase
: https://github.com/the-programmers-hangout/website/blob/34047cc05cd5e7c5c4e5335e4b13e0c09ab0a5f9/src/utils/index.ts#L155One solution would be to fork or use an internally modified version of the plugin.
See how lodash.com/gatsby does it: https://github.com/lodash/lodash.com/tree/gatsby/plugins/gatsby-source-lodash