Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,22 @@ jobs:
run: npm run typecheck
- name: 🔤 Spell Check
run: npm run spellcheck
# Docusaurus derives a heading's anchor from its text, so renaming a
# heading moves the anchor and breaks every inbound link. An explicit id
# survives the rename, and lets a translation keep the English anchor
# after the heading text is translated.
#
# Nothing in Docusaurus enforces this: a page whose headings are all
# unpinned builds clean. So run its own generator and fail if it had
# anything to add.
- name: 🔗 Heading IDs
run: |
npm run heading-ids
if ! git diff --quiet -- docs; then
echo "::error::Headings are missing explicit ids. Run \`npm run heading-ids\` and commit the result."
git diff -- docs
exit 1
fi
- uses: ./.github/workflows/actions/check-translations

cross-platform:
Expand Down
11 changes: 10 additions & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,16 @@ module.exports = {
ja: { label: '日本語' },
},
},
onBrokenLinks: 'warn',
/**
* A broken link or anchor fails the build instead of warning, so a stale
* cross-reference cannot reach production unnoticed.
*
* `build:preview` passes `--locale en`, so a pull request preview only
* ever checks English. A regression in a translated locale surfaces in
* the production build, which builds every locale.
*/
onBrokenLinks: 'throw',
onBrokenAnchors: 'throw',
future: {
v4: {
/**
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"deploy": "docusaurus deploy",
"docusaurus": "docusaurus",
"generate-markdown": "node scripts/native.mjs && node scripts/cli.mjs && node scripts/release-notes.mjs",
"heading-ids": "docusaurus write-heading-ids . \"docs/**/*.mdx\" \"!docs/native/**\" \"!docs/cli/commands/**\" --syntax mdx-comment",
"lint": "npm run prettier -- --write",
"serve": "docusaurus serve",
"playground:new": "hygen playground new",
Expand Down
Loading