I built a zero-dependency CLI to audit hreflang (international SEO)
说明与用途
零依赖 CLI 工具,用于审核 hreflang 标签,报告问题并提供修复提示,适合 CI 集成。
问题
Sites with multiple languages often have hreflang issues that are invisible in the browser but hurt SEO, such as missing return links, invalid language codes, or canonical conflicts.
结果
The CLI identifies common hreflang problems and provides actionable fix hints, improving international SEO and enabling automated regression checks in CI pipelines.
工作流
- Clone the repo
- Run the offline demo with seeded issues
- Execute the CLI against a real site URL
- Review the report or use --json for automation
- Integrate the CLI into a GitHub Action for scheduled audits
证据
hreflang-audit is a single-file Node.js 20+ CLI with zero npm dependencies. It crawls your site (or parses your XML sitemap, sitemap-index included), reads <link rel="alternate" hreflang> elements, HTTP Link: headers, and xhtml:link sitemap entries, and runs 11 checks …
- 记录日期: 2026-09-07T01:37:47.402Z