the-programmers-hangout/website

Replace or fix markdown auto headers

veksen opened this issue · 1 comments

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 Lodash kebabCase:

link: `#${kebabCase(h!.value!)}`,

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