markdownlint
markdownlint copied to clipboard
Frontmatter interpreted as top-level heading
When using a frontmatter, I get the following warning:
That scenario is correct and documented: https://github.com/DavidAnson/markdownlint/blob/main/doc/md025.md
I see. Yet I don't understand what's the rationale behind this choice, and what's the recommended change when you want to have the h1 header and the page title to be the same.
Some systems (Jekyll, perhaps?) automatically use the front matter title as the H1 for the rendered page. In that scenario, what you show here would result in a duplicate title at the top of the blog. If that's not relevant for your situation, it's probably best to disable this rule at a project level.
How can you disable it at the project level? I'm using Astro btw.
I don't know anything about how Astro works, but the typical way to do this would be to put a .markdownlint.json file in the root of the project. It only needs to disable the relevant rule by giving it the value false, but here is a complete example of what that file could contain: https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.jsonc