Skip to content

IndexNow for Astro, Hugo & Static Sites

Host your IndexNow key file cleanly in Astro, Hugo, Hexo, or Eleventy and submit canonical post-build sitemap updates.

Where to place the key file in static site generators

Astro
Place <key>.txt in public/<key>.txt. Astro copies public/ verbatim to dist/ without applying layout wrappers or HTML transforms.
Hugo
Place <key>.txt in static/<key>.txt so Hugo publishes it directly at /<key>.txt alongside robots.txt and sitemap.xml.
Eleventy / Hexo / Jekyll
Add <key>.txt to your passthrough copy directory (or source/ in Hexo) and ensure clean-URL rules do not append a trailing slash to .txt paths.

Avoid canonical and trailing-slash drift

Static hosts (Cloudflare Pages, Netlify, Vercel, GitHub Pages) differ in whether /about redirects to /about/. Always submit the exact canonical URLs emitted in your sitemap.xml rather than hand-constructed paths.

# Example: fetch live sitemap (with nested sitemap-index support) and submit URLs changed in the last 1 day
node cli/submitnow.ts submit \
  --sitemap https://www.example.com/sitemap-index.xml \
  --lastmod-days 1 \
  --key "$INDEXNOW_KEY"