Skip to content

What is a static site generator (SSG)?

A static site generator is a tool that builds every page of a website into ready-made HTML files ahead of time, usually from templates plus content in Markdown or a headless CMS. The files are then served as they are, often from a CDN, with no server rendering pages on each request.

How static generation works

At build time the generator reads the content, applies the templates and writes one HTML file per page, along with optimised CSS, JavaScript and images. When content changes, the site is rebuilt, often automatically through a webhook from the CMS.

Why it is popular

Pre-built pages are fast to serve, cheap to host and have a small attack surface, since no database or application server answers public requests. Well-known generators include Astro, Hugo, Eleventy and Jekyll, and frameworks such as Next.js can export static pages too.

When it is not enough

Pages that change for each visitor, such as dashboards or carts, need server rendering or code in the browser. Many modern frameworks mix the two, building most pages statically and rendering a few on demand.

Want this working on your site?

Tell us about your site and what you want it to do, and we will say what we would change first.