Marsen Astro SEO build check — tested 13 October 2026
What it does
check-astro-seo.mjs reads an Astro static build (dist/) and the sitemap written by
@astrojs/sitemap. For every sitemap URL it checks: a built HTML file exists, the
entry has lastmod, exactly one canonical equal to the sitemap URL, no noindex,
a title and meta description, og:url matching the canonical, exactly one
,
JSON-LD that parses with no @id fully defined twice,
alt attributes and
internal links that resolve inside the build. It also reports duplicate titles
and descriptions across the sitemap. No dependencies; Node.js 20 or later.
Run it
1. Build your site: npm run build (or pnpm/yarn equivalent).
2. From the project root: node check-astro-seo.mjs https://www.your-domain.com dist
3. Exit code 0 means no issues were found; 1 lists each issue by URL.
Reproduce our negative test
1. In an empty folder, save check-astro-seo.mjs and make-fixture.mjs.
2. node make-fixture.mjs
3. node check-astro-seo.mjs https://example.com fixture/dist
Expected: exit code 1 and the 12 injected faults listed in test-results.json.
The clean control page /a reports no issues.
Evidence (test-results.json)
- Negative fixture: 12 injected faults, 12 detected, control page clean.
- www.marsentech.com production build (Astro 7.3.2, @astrojs/sitemap 3.7.4):
68 sitemap URLs, 0 pages with issues, 0 duplicate titles or descriptions.
Limits
It does not fetch the live site, follow host redirects, read robots.txt rules,
render JavaScript, validate Schema.org vocabulary or rich-result eligibility,
measure page speed or predict rankings. Parsing is regex-based for the tags it
checks; unusual markup may need adjustment.
Copyright Marsen Technologies. Published for inspection and evaluation; see
../README.txt for reuse status.