Repository navigation
fix: remove duplicate H1s from docs pages and lint against them - #53
Merged
Merged
Conversation
Starlight renders the frontmatter title as the page H1, so the leading # heading in 27 pages showed the title twice. Remove those headings, promote the clearer wording into the title for the Auth API and CLI pages, and fail npm run lint when a body H1 is added again. Closes #52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Starlight renders each page's frontmatter
titleas the H1. 27 pages undersrc/content/docs/also opened with a#heading, so the title appeared twice and the outline had two top-level headings.#heading from all 27 pages.titleon two pages (this also updates their sidebar label and<title>tag):build/auth-api.mdx: "Auth API Server" to "Seamless Auth API"operate/CLI.mdx: "CLI" to "Seamless Auth CLI"scripts/check-no-h1.mjs, run bynpm run lint(and so by the pre-commit hook). It fails when a docs page has a line starting with#outside a code fence.No URLs change, so no redirects are needed.
Testing
npm run lint,npm run typecheck,npm run buildall pass./build/react-native-sdk,/build/auth-api,/operate/cli) contain a single<h1>.#heading to a page makesnpm run lintfail, naming the file and line.Closes #52