# Google Search Console verification on Cloudflare Pages / Astro

Use this when the user provides a Google Search Console HTML verification file and wants it served from the site root, especially for Astro sites deployed on Cloudflare Pages.

## Workflow

1. Get the exact verification file from the user-provided source.
   - For Google Drive via `gog`, search by exact filename first, then by partial token if needed.
   - Preserve the filename exactly, e.g. `google<token>.html`.
2. Treat the file as a static root asset.
   - In Astro, put it under `public/<filename>.html`.
   - Do not create an Astro route/component for this; Google expects the exact path and body.
3. Verify local copy fidelity.
   - Confirm file exists, byte size is plausible, and content is not accidentally wrapped or reformatted.
4. Build and check the generated artifact.
   - Run the normal site build/production QA.
   - Confirm `dist/<filename>.html` exists and bytes match `public/<filename>.html` exactly.
5. Commit/push/deploy.
6. Verify live with byte equality.
   - Poll `https://<site>/<filename>.html` until it returns `200`.
   - Compare the live response bytes to the local `public/` file, not merely status code.
7. Tell the user the exact verification URL to paste/check in Search Console.

## Pitfalls

- Do not edit or prettify the Google verification file. A single added newline or wrapper HTML can break verification.
- Do not place the file under `src/pages/` unless there is a deliberate reason; `public/` is simpler and safer for exact static assets.
- Cloudflare Pages may return `404` for the first poll immediately after push. Retry briefly before reporting failure.
- If the user asks whether Google can find the site, distinguish two separate checks:
  - **Verification file reachable:** direct `200` + byte match.
  - **Search indexing:** requires Search Console indexing/crawl status; automated Google `site:` checks may be blocked and are not authoritative.
