Back to Blog

SEO Checklist for a Static Site: Sitemap, Hreflang, and Schema

#seo#astro#static-site
SEO Checklist for a Static Site: Sitemap, Hreflang, and Schema

After moving to Astro, I briefly forgot something important: a static site isn’t automatically SEO-friendly just because it’s fast. A few technical things still need to be handled manually.

Sitemap. I set up @astrojs/sitemap, which generates sitemap-index.xml automatically at build time based on the site defined in astro.config.mjs. No manual maintenance — just submit it once to Google Search Console.

Hreflang for the bilingual setup. Since this site has an Indonesian version (/) and an English version (/en/...), I need to tell Google these are language variants of the same content, not duplicate content. That’s done with <link rel="alternate" hreflang="..."> tags in the <head> of every page, pointing to the equivalent URL in the other locale. Without this, Google risks treating one version as a duplicate and not surfacing both properly in search results.

Schema markup. I added JSON-LD Person schema to the main layout — name, job title, address, and areas of expertise. This isn’t a direct ranking factor, but it helps Google (and AI search) understand who I am as an entity, which matters if a knowledge panel or rich result ever shows up.

robots.txt. Simple, but easy to forget. It just allows all crawlers and points to the sitemap location. Small detail, but it’s the first thing a crawler reads before it even touches the rest of the site.

What I learned: technical SEO for a static site is 80% getting metadata right and consistent, not tricks. Astro already helps a lot on the performance side (Core Web Vitals tend to be good by default thanks to minimal JavaScript), so the biggest remaining work is administrative stuff like the above.