Beacon · SEO & discoverability
index-beacon
Check which pages of your built static site search engines are told not to index or follow, via meta robots and X-Robots-Tag, against the rules you actually intend.
npm i -D @mrlouiswright/index-beaconPublished to GitHub Packages: add @mrlouiswright:registry=https://npm.pkg.github.com to .npmrc first (installing needs a token with read:packages).
What it checks
- Intentdeclare which pages should be
noindex(noindexglobs; sensible defaults such as/search,/admin/,/drafts/,/thank-you*,/cart*), which must stay indexable (indexglobs win), and wherenofollowis intended… - Leakssite-wide noindex, from a
/*header rule or because every page is noindex (critical). - Per pageunexpected
noindex/none, unexpectednofollow, indexable pages that should be noindex, passedunavailable_afterdates. - Correctnessrobots meta outside
<head>, contradictory directives (index + noindex, meta vs header), bot-specific rules (googlebot, bingbot, ...) that disagree with the generic one, unknown or misspelt directives (no-index). - Visibility
nosnippet/max-snippet:0on indexable pages (hides them from rich results and AI answers) andnoimageindex.
Quick usage
CLI
npx index-beacon dist
npx index-beacon dist --noindex "/internal/**,/landing/test-*" --fail-on medium
npx index-beacon public --index "/search" --nofollow "/user/**"
npx index-beacon out --no-defaults --report-intended --format markdown
API
import { check, DEFAULT_NOINDEX } from "index-beacon";
const report = check("dist", { noindex: ["/internal/**"], index: ["/search"] });
console.log(report.info.noindex, report.findings);
Every option is documented in the index-beacon docs.
CI / GitHub Action
permissions:
contents: read
security-events: write # only needed for the SARIF upload
jobs:
index-beacon:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with: { persist-credentials: false }
- run: npm ci && npm run build # produce the static site first
- uses: MrLouisWright/index-beacon@v1
with:
path: dist
fail-on: high
sarif: index-beacon.sarif
- uses: github/codeql-action/upload-sarif@v3
if: always()
with: { sarif_file: index-beacon.sarif }