Skip to content

ci: lint markdown frontmatter#2032

Merged
guoqqqi merged 1 commit intomasterfrom
add-frontmatter-lint
Apr 16, 2026
Merged

ci: lint markdown frontmatter#2032
guoqqqi merged 1 commit intomasterfrom
add-frontmatter-lint

Conversation

@guoqqqi
Copy link
Copy Markdown
Member

@guoqqqi guoqqqi commented Apr 16, 2026

Summary

  • Add a lint:frontmatter script that parses Markdown/MDX YAML frontmatter with js-yaml.
  • Run the check in the existing lint workflow so malformed frontmatter is caught before a Docusaurus blog build.

Why

Verification

  • yarn install --frozen-lockfile --ignore-scripts
  • yarn lint:frontmatter
  • ./node_modules/.bin/eslint scripts/lint-frontmatter.js .github/workflows/lint.yml

@guoqqqi
Copy link
Copy Markdown
Member Author

guoqqqi commented Apr 16, 2026

Additional local verification:

  • Temporarily reverted the fixed description in blog/en/blog/2022/07/30/why-we-need-apache-apisix.md to the malformed unquoted value from fix(seo): optimize titles and descriptions for 50 blog posts (batch 2) #2021.
  • yarn lint:frontmatter failed as expected and reported the exact file plus YAML parse location.
  • Restored the quoted description and reran yarn lint:frontmatter; it passed.

@guoqqqi guoqqqi requested review from Baoyuantop and Yilialinn April 16, 2026 07:31
@guoqqqi guoqqqi merged commit f2c8a6b into master Apr 16, 2026
4 checks passed
@guoqqqi guoqqqi deleted the add-frontmatter-lint branch April 16, 2026 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants