Part of the JavaScript SEO series. For the full picture, start with JavaScript SEO: the complete rendering and indexing guide.
Every popular static site generator can produce a page that ranks. The differences that matter for SEO and AI search are narrower than framework debates suggest: whether each page’s content and links are in the HTML before any script runs, how much JavaScript ships on top, and which SEO pieces (sitemap, canonicals, hreflang, redirects) the framework handles versus leaves to you.
This comparison covers eight generators people actually choose between: Astro, Next.js (static export), Nuxt, SvelteKit, Hugo, Eleventy, VitePress and Docusaurus. Every claim about a framework comes from its own documentation, linked in place. Whichever you pick, the static site SEO checklist covers what you still have to build.
What is the best static site generator for SEO?
The best one is the one that keeps all indexable content in the prerendered HTML with the least effort for your kind of site. There is no ranking bonus for a framework name. Google’s JavaScript SEO basics says “server-side or pre-rendering is still a great idea” because it makes sites faster for users and crawlers, and because “not all bots can run JavaScript.” Every generator here pre-renders; what changes is how easy it is to break that by accident.
A short answer by use case:
| Site | Strong default choice | Why |
|---|---|---|
| Blog, marketing site, content hub | Astro or Eleventy | HTML with no client JavaScript by default; interactivity only where you add it |
| Large content site in many languages | Hugo | Sitemap per language with alternate links, robots.txt, Open Graph and X card partials built in |
| Documentation | Docusaurus or VitePress | Sitemap, canonicals and (Docusaurus) hreflang handled for you |
| A React, Vue or Svelte app with public pages | Next.js, Nuxt or SvelteKit in static mode | Reuse the app’s components; watch for content fetched in the browser |
If the team already knows one of the app frameworks, staying with it is usually better than switching, as long as you check the points in the framework sections below.
Why does static HTML matter for AI search?
Because most AI crawlers read only the HTML response. In Vercel’s analysis of AI crawler traffic (December 2024), “none of the major AI crawlers currently render JavaScript.” The exceptions were Gemini, which “leverages Googlebot’s infrastructure”, and AppleBot, which renders through a browser-based crawler. Vercel’s advice: “Prioritize server-side rendering for critical content.”
Google’s AI features follow the same rules as Search. Its AI features documentation says a page only has to be indexed and eligible to show with a snippet, and lists the usual best practices: allow crawling, link to the page internally, keep important content available as text, and make structured data match the visible text.
So the bar for AI search is slightly higher than for Google. Googlebot renders JavaScript after a queue; ChatGPT’s and Claude’s crawlers don’t render it at all. A generator that puts content in the HTML clears both. The AI search readiness checklist covers the other requirements, such as robots.txt rules for AI crawlers.
How do the frameworks compare for SEO?
This table compares the defaults in each framework’s static mode. “You write it” means the documentation shows how, but nothing is generated until you do.
| Framework (static mode) | Client JavaScript by default | Sitemap | hreflang | Redirects |
|---|---|---|---|---|
| Astro | None unless a component uses client:* |
Official @astrojs/sitemap integration; alternates via its i18n option |
You write the head tags | Static build writes meta refresh pages; use the host |
Next.js (output: 'export') |
React hydration, client-side navigation | sitemap.ts file convention, with alternates.languages |
alternates.languages in metadata |
next.config redirects and headers unsupported; use the host |
Nuxt (nuxt generate) |
Vue hydration, data in _payload.json |
Not in the prerendering guide; list /sitemap.xml in prerender routes |
@nuxtjs/i18n adds hreflang, canonical and og:locale |
Use the host |
SvelteKit (adapter-static) |
Hydration unless csr = false |
You write a sitemap.xml route |
You write it | Use the host |
| Hugo | None from Hugo itself; only what your theme adds | Built in, per language plus a sitemap index, with alternate links | You write the head tags from .Translations |
Aliases are meta refresh pages by default; can generate a server redirect file |
| Eleventy | None (“no costly runtime JavaScript bundles”) | You write a template over collections.all |
i18n plugin gives the links; you write the tags | Use the host |
| VitePress | Vue hydration of dynamic parts, then SPA | Built in once sitemap.hostname is set; lastmod with lastUpdated |
Not covered in the sitemap guide | Use the host |
| Docusaurus | React hydration, then SPA | Built in via preset-classic |
Automatic when i18n is configured | Use the host |
Two columns decide most outcomes. JavaScript decides how much can go wrong for crawlers that don’t render. Redirects decide how you handle moved URLs: on a static host, only the host’s configuration can send a real 301 or 308.
Astro
Astro is built for content sites. Its islands documentation says it renders every UI component “to just HTML & CSS”, “stripping out all client-side JavaScript automatically”, and a component becomes interactive only with a client:* directive. You can use React, Vue or Svelte components and still ship no JavaScript for them.
What Astro leaves to you:
- Head tags. Title, description, canonical and hreflang are written in your own layout from
Astro.urlandAstro.site. - Sitemap details. The sitemap integration includes every page by default, adds no
<lastmod>unless you set it, and only excludes pages through itsfilterfunction, so noindex pages have to be filtered by hand. Itsi18noption addsxhtml:linkalternates to each URL. - Redirects. On a static build, Astro’s
redirectsoption writes HTML pages with a meta refresh, not server redirects. Put moved URLs in the host’s config.
The Astro SEO guide builds all of this step by step.
Next.js (static export)
Next.js produces static HTML with output: 'export'. Its static exports guide says Server Components run during the build and are “rendered into static HTML for the initial page load and a static payload for client navigation between routes.” After the first page, navigation happens client-side, like a single-page app.
The SEO tooling is the most complete of the app frameworks. The metadata API takes alternates.canonical and alternates.languages for canonical and hreflang tags, and a sitemap.ts file generates the sitemap, including alternates.languages for localized URLs.
Watch three things:
- Unsupported features. The static exports guide lists redirects, rewrites, headers, Proxy and Incremental Static Regeneration among the features a static export can’t use. Redirects and
X-Robots-Tagheaders move to the host. - Content fetched in Client Components. The guide’s own example fetches data in the browser with SWR and returns
'Loading...'until it arrives. Content loaded that way isn’t in the exported HTML, so crawlers that don’t render see the loading state. Fetch content in Server Components instead. - Metadata when you leave static export. With server rendering, Next.js can stream metadata: when
generateMetadataresolves, the tags “are appended to the<body>tag”. Next.js detects “HTML-limited bots” from a user-agent list and serves them metadata in the head; thehtmlLimitedBotsoption overrides that list. In a static export, metadata that can be prerendered is in the initial HTML.
The Next.js SEO guide sets up metadata, sitemaps and status codes in the App Router step by step.
Nuxt
nuxt generate prerenders a Nuxt app. The prerendering guide says the Nitro crawler starts at /, saves each page’s HTML and _payload.json, then follows the links on each page to find more routes. Fetched data goes into the payload so the client can hydrate without re-fetching.
The crawler has an SEO side effect: “pages that are not linked to a discoverable page can’t be pre-rendered automatically.” An orphan page is missing from the build, not just hard to find. List such routes, and files like /sitemap.xml, in the prerender routes option.
For head tags, useSeoMeta sets meta tags as a typed object. For multilingual sites, the @nuxtjs/i18n SEO features add hreflang links, a canonical and og:locale tags through useLocaleHead(), once locales have a language value and baseUrl is set to the production domain.
SvelteKit
SvelteKit’s SEO page says it “employs SSR by default” and redirects trailing-slash variants to one form. It doesn’t build a sitemap; the docs show writing one as a sitemap.xml route.
For a static site, adapter-static needs export const prerender = true in the root layout. Its fallback option turns the site into a single-page app for pages that weren’t prerendered, and the docs warn that it “has large negative performance and SEO impacts.” Leave it off for public sites.
Like Nuxt, the prerenderer finds pages by following <a> links (page options). Unlike most app frameworks, SvelteKit lets you drop JavaScript per page: “Disabling CSR does not ship any JavaScript to the client.”
Hugo
Hugo has the most SEO built in of the general-purpose generators. Its sitemap templates generate a sitemap by default, one per language plus a sitemap index on multilingual sites, and a page leaves the sitemap with sitemap: { disable: true } in front matter. The embedded template adds an xhtml:link alternate for each translation. Hugo also has embedded partials for Open Graph, schema microdata and X cards, and it generates robots.txt when enableRobotsTXT is on.
Two things to set up yourself:
- hreflang in the head.
.Translationsreturns a page’s other language versions; write the<link rel="alternate">tags from it in your base template, including the page itself andx-default. Many themes do this, so check the output. - Redirects. By default, aliases are “client-side redirection”, a small HTML file with a meta refresh. Hugo can instead generate a server config file such as Netlify’s
_redirectsor an.htaccess, which the docs call “more efficient because the redirect happens at the HTTP header level.” Prefer that for SEO.
Eleventy
Eleventy outputs what your templates write and nothing more. Its performance page says “we do not include any costly runtime JavaScript bundles”, and it points to its <is-land> component when a page needs interactivity.
That freedom extends to SEO. There’s no built-in sitemap: you write a template that loops over collections.all and keep feeds and the sitemap itself out with eleventyExcludeFromCollections. The i18n plugin provides locale_links for each page’s translations, and its example writes the hreflang tags in the layout, noting that the href must be fully qualified.
VitePress and Docusaurus
Both are documentation generators that prerender HTML and then become single-page apps.
VitePress serves pre-rendered HTML on the first visit, hydrates only the dynamic parts of each page, and “becomes a Single Page Application” for later navigation. It generates a sitemap once you set sitemap.hostname, with <lastmod> when lastUpdated is on. Its sitemap guide doesn’t cover hreflang.
Docusaurus does the most for you: canonical links and other metadata on every Markdown page, a hreflang alternate link when i18n is configured, and a sitemap through the sitemap plugin in preset-classic. Its static generation docs call the static HTML an optimization: “Docusaurus is ultimately a single-page application.” Content written in Markdown is in the HTML; content a custom React component fetches in the browser is not.
What breaks SEO on any static site generator?
The framework rarely causes the problem. These patterns do, and each shows up in more than one of the generators above:
| Pattern | Where it appears | Effect | Fix |
|---|---|---|---|
| Content fetched in the browser | Any framework with client components | Missing for crawlers that don’t render | Fetch at build time |
| SPA fallback for unbuilt pages | SvelteKit fallback, Nuxt 200.html |
Empty shell where a page should be | Prerender every public page |
| Pages only reachable without links | Nuxt and SvelteKit crawl links to prerender | Page missing from the build | Link it, or list the route |
| Meta refresh redirects | Astro static redirects, Hugo aliases | Weaker than a 301 or 308 | Redirects in the host config |
| Every page in the sitemap | Astro, Next.js, Eleventy (whatever you list) | Noindex or redirected URLs submitted | Filter from the same data as noindex |
| Head tags added by scripts | Client-side head managers | Missing for crawlers that don’t render | Render tags at build time |
The static site SEO checklist covers the fixes for canonicals, trailing slashes, 404s and post-build checks, which apply to all eight frameworks.
How do you test a framework before committing to it?
Build a few real templates (home, a listing, an article, a page with your most interactive component) and check the output the way a non-rendering crawler would:
- Read the built HTML. Open the file in the output folder, or
curlthe deployed page, and confirm the body text, internal links, title, canonical, hreflang and JSON-LD are there. - Compare raw and rendered HTML across the site. In Crawlens, turn on Render JavaScript when you start a crawl. Each page is fetched as-is and rendered in Chromium, and the audit flags content that depends on JavaScript, links only in rendered HTML and JavaScript that changes SEO tags. On a well-built static site, all three should be empty. The raw versus rendered HTML guide explains each check.
- Check status codes on the host. Request a moved URL and a missing URL, and confirm a real redirect and a real 404.
- Check the sitemap against noindex. Every URL in it should return 200, be indexable and be canonical.
Static site generator SEO checklist
- Every public page is prerendered; no SPA fallback for public URLs.
- Body content and internal links are in the HTML, not fetched in the browser.
- Title, description, canonical, robots meta, hreflang and JSON-LD are rendered at build time.
- JavaScript ships only where a page needs interactivity.
- The sitemap lists only indexable, canonical URLs, with real
<lastmod>dates. - Moved URLs get 301 or 308 redirects from the host, not meta refresh pages.
- Pages that only crawl-based prerendering would miss are linked or listed.
- A rendered crawl shows no content, links or SEO tags that exist only after JavaScript runs.
Frequently asked questions
Is Astro better than Next.js for SEO?
Neither ranks better by itself. Both can put full content in the HTML at build time. Astro ships no client JavaScript unless a component opts in, which makes content-heavy sites simple to keep crawlable, while a Next.js static export hydrates React and drops next.config redirects and headers, so you set those on the host.
Do AI crawlers see content from a static site generator?
They see whatever is in the HTML response. Vercel's December 2024 analysis found that none of the major AI crawlers it measured render JavaScript, apart from Gemini and AppleBot. Prerendered pages are fine; content a component fetches in the browser is invisible to those crawlers.
Does hydration hurt SEO?
Not when the content is already in the prerendered HTML. Hydration only attaches JavaScript to markup that exists. It becomes a problem when content, links or head tags appear only after scripts run, which is what a raw-versus-rendered HTML comparison catches.
Is Hugo good for SEO?
Yes. Hugo writes plain HTML, generates a sitemap by default (one per language plus an index on multilingual sites, with alternate-language links) and has built-in partials for Open Graph and X cards. Its default aliases are meta refresh pages, so add real redirects on your host for moved URLs.
Which static site generator is best for documentation SEO?
Docusaurus has the most SEO done for you: canonical links, hreflang alternates when i18n is configured, and a sitemap through its classic preset. VitePress also builds a sitemap once you set a hostname. Both hydrate into a single-page app after the first load, with content in the initial HTML.