A static site generator (SSG) turns content (Markdown, data files, a headless CMS) plus templates into plain HTML files, which any web server or CDN can serve, fast and securely. There are dozens of SSGs. These are the ones most worth considering, and how they differ.

Background: Jamstack explained and static vs dynamic sites.

At a glance

Generator Language Build speed Templating Strengths
Astro JavaScript/TypeScript Fast .astro components; use React/Vue/Svelte where needed Content collections, zero JS by default, islands, optional SSR
Hugo Go (single binary) Fastest Go templates Thousands of pages in seconds; no Node.js needed
Eleventy (11ty) JavaScript Fast Nunjucks, Liquid, Markdown, JS Simple, flexible, minimal opinions
Jekyll Ruby Slower on large sites Liquid Mature; GitHub Pages native
Next.js / Nuxt (static export) JS (React/Vue) Moderate React/Vue components When the team already uses those frameworks
Docusaurus / VitePress / MkDocs JS / Python Fast Docs-focused Documentation sites

Choosing

  • Content-heavy marketing sites and blogs with some interactivity: Astro. Components and great performance, and it ships no JavaScript unless a component needs it. See deploy a static Astro site.
  • Very large sites (thousands of pages), or no Node.js: Hugo. See Hugo static site.
  • Simple sites, maximum control, minimal tooling: Eleventy.
  • Existing Jekyll site / GitHub Pages: Jekyll is fine, though builds slow down on large sites.
  • Documentation: Docusaurus, VitePress, MkDocs (Material), or Astro Starlight.
  • App-like sites with shared React/Vue code: Next.js or Nuxt, with static export or hybrid rendering. See deploy Next.js.

Features to compare

Feature Why it matters
Markdown/MDX support Writing experience
Image optimisation Automatic resizing, WebP/AVIF (Astro, Hugo, Eleventy plugin)
Content collections / data files Typed content, validation
i18n Multilingual sites
Incremental builds Large sites rebuild faster
CMS integration Headless CMS or Git-based editors. See headless CMS options
Search Pagefind and similar static search indexes

Hosting the output on a VPS

All SSGs output a folder of static files (dist/ or public/). Serve it with Nginx:

server {
    server_name example.com;
    root /var/www/example.com/dist;
    location / { try_files $uri $uri/ $uri.html =404; }
    error_page 404 /404.html;
    location ~* \.(css|js|woff2|webp|avif|png|jpg|svg)$ {
        expires 1y;
        add_header Cache-Control "public, immutable";
    }
}

Enable compression (gzip/Brotli), and HTTPS with Certbot. See Nginx gzip and Brotli and Let’s Encrypt.

Deploy from CI with rsync, or build on the server:

npm ci && npm run build && rsync -az --delete dist/ deploy@vps:/var/www/example.com/dist/

See GitHub Actions deploy to VPS.

A small VPS can serve a static site to a very large audience. Add a CDN for global visitors. See CDN for websites.

Migrating between generators

Content in Markdown with front matter moves easily. Templates and shortcodes need rewriting. Keep URLs identical, or add 301 redirects, to preserve SEO. See WordPress redirects for redirect concepts.

Quick reference

Need Pick
Modern content site, components Astro
Fastest builds, huge sites Hugo
Minimal and flexible Eleventy
GitHub Pages simplicity Jekyll
Docs Starlight / Docusaurus / VitePress / MkDocs

Related: website speed optimization and Nginx static file caching.

  • Static Sites
  • Web Development
  • Comparison