What is a static site generator?
A static site generator is a tool that builds a website’s pages into ready-made HTML files ahead of time, from templates and content, so a server or CDN can deliver them instantly without assembling each page on request.
Pros and limits of a static site
Pre-built pages are fast, cheap to host and hard to break. There is no database to attack and no server code to patch on every request, and each page arrives as complete HTML that search engines and AI crawlers can read immediately. That makes static sites the usual choice for content and marketing sites, docs and blogs, served from a CDN.
The limits: content changes need a rebuild, very large sites take longer to build, and personalized or highly dynamic pages need extra work. Modern frameworks such as Astro and Next.js blur the line by mixing static pages with server-rendered ones where needed.
How we use a static site generator
We use static generation for most marketing sites we code, usually with Astro, and connect a headless CMS so edits trigger a rebuild. Our own website is built by a small generator written for it, with no framework dependencies, because it is the clearest way to keep every page, price and link generated from one source.
See Astro development and how the site itself fits into our process.
Related service: Astro development · How we work
Static site generator in practice
This website is a static generated site. Page content lives as data in content modules; a build script renders every page to an HTML file, writes the sitemap, robots.txt and llms.txt, and records what it generated. A separate check script then opens every file, resolves every internal link, validates the structured data and fails the build on errors. The output is plain files that any host can serve.
Common mistakes
- Forcing dynamic features into static pages. Logged-in dashboards and real-time data belong in an app or server-rendered routes.
- Slow builds at scale. Thousands of pages can take minutes to rebuild. Use incremental builds or on-demand rendering for large content.
- No editing workflow. Without a CMS, every change needs a developer. Plan for editors from the start.
How a static site generator works
- 01
Write content
Pages start as Markdown files, data files or entries in a headless CMS.
- 02
Add templates
Layouts and components define how each type of page looks.
- 03
Run the build
The generator combines content and templates and renders every page to HTML.
- 04
Deploy to a CDN
The HTML, CSS and images go to a CDN that serves them from a location near each visitor.
- 05
Rebuild on change
An edit in the CMS or a code commit triggers a new build, so the site stays current.
Popular static site generators
The right SSG depends on your team’s language and how much content you have. Checked December 2026.
| Generator | Language | Best fit |
|---|---|---|
| Astro | JavaScript, TypeScript | Content and marketing sites with interactive parts where needed |
| Hugo | Go | Large content sites and docs that rebuild often |
| Eleventy | JavaScript | Simple sites and blogs with flexible templates |
| Jekyll | Ruby | Blogs and project sites on GitHub Pages |
| Next.js static export | JavaScript, React | React teams that want static pages now and server features later |
Static, server-rendered or hybrid
Static generation is one of three ways to render a site; pick by how often the content changes and how personal each page is.
| Model | How pages are made | Fits |
|---|---|---|
| Static | Built to HTML ahead of time | Marketing sites, docs, blogs |
| Server-rendered | Built on the server for each request | Logged-in pages, live data, personalization |
| Hybrid | Static by default, server-rendered per route | A marketing site with a few dynamic pages |
Questions about static site generator
Is a static site good for SEO?
Can a static site have forms and search?
Which static site generator is best?
Is Next.js a static site generator?
Can marketers edit a static site?
Thomas OldenburgerFounder, design and build leadStill deciding? A 30-minute call answers most of it.
Related terms
Astro
Astro is an open-source web framework for content-focused websites that renders pages to HTML at build time or on the server and ships no client-side JavaScript by default, adding interactivity only where a component needs it.
Definition Website and CMSHeadless CMS
A headless CMS is a content management system that stores and serves content through an API, without its own front end, so the same content can be displayed by any website, app or channel.
Definition SEO and AEOCore Web Vitals
Core Web Vitals are Google’s three field metrics for page experience: Largest Contentful Paint (loading, good at 2.5 seconds or less), Interaction to Next Paint (responsiveness, good at 200 milliseconds or less) and Cumulative Layout Shift (visual stability, good at 0.1 or less).
Definition SEO and AEOllms.txt
llms.txt is a proposed standard for a Markdown file at the root of a website (or of a section) that gives AI agents and language models a short summary of the site and a curated list of links to its most useful content.
Definition