Skip to main content

PHP has a Static Site Generator

Symfony is a great framework — especially for the complex stuff.

But when it comes to plain websites, I saw only two real options for years:

  • a CMS like Drupal or Sulu
  • a stripped-down Symfony application

Both need a web server, a PHP runtime — and sometimes even a database.

For the bit of HTML that ends up being served from the edge via HTTP cache anyway, I always considered this unnecessary — and above all, expensive.

So I started playing with the idea of building my personal site as a Static Site Generator (SSG). Cloudflare Pages, for instance, cost close to nothing and serve pre-rendered HTML at edge speeds — no server, no PHP, no database.

As a Symfony enthusiast, I naturally wondered whether I could pull this off with the Symfony framework itself. I remembered Sculpin — a Static Site Generator built on Composer, Symfony components and Twig. Sculpin is a genuinely great project, but it's very much its own thing — structurally and conceptually quite different from the Symfony framework as we know it.

So I was already leaning toward Next.js, Gatsby or Hugo. Then I stumbled across Stenope.

This wonderful Symfony bundle turns any Symfony project into a Static Site Generator in no time at all. And even when rendering static HTML isn't the goal, Stenope's clean content model puts a powerful tool in our hands.

Last updated on