Personal tools

Skip to content. | Skip to navigation

Internet solutions

Navigation

You are here: Home / Blog / Finally found a way to deploy a Plone site statically

Finally found a way to deploy a Plone site statically

Until now converting Plone into a bunch of HTML, CSS and JS files was a work to be done with wget or curl. You can now use stxnext.staticdeployment product, a handy product to convert your Plone site into static files. And even works with Dexterity. The "Plone Big Green Button" as described by Martin Aspeli, is a reality.

One of our clients came to us with a very specific requirement: we want to use Plone and we are not going to expose Plone, we need you to convert it to a static site.

Clients requirements didn't allow to expose Plone in production, as they wanted to serve everything in static to have the fastest possible user experience, so we started to analyze our options.

The first option was to run a wget command to get the static site. That was the easiest and fastest way to get our goal, and we were confident that it would work but our hands were tied to it and we wanted some more control over the statification process.

After some search, we found stxnext.staticdeployment. A product made by a polish company that fit exactly our needs: a Plone product to convert a dynamic Plone site into a static one. The product had a lot of features, such a content-type filter to decide which content-types to deploy statically. Or custom deployment steps to run after the deployment was made to fix some issues or made last-minute adjustments. It looked perfect, but... it had just one drawback: it did not support dexterity content-types and we were using them. We started to work on it, and we managed to adapt the product soon to be dexterity-compatible.

We also made some other changes to have a predictable way of getting the static site because the client wanted to deploy the static site several times a day, so we needed some other changes: execute extra custom deployment steps in a given order, fix the produced HTML files, have proper logging of all deployment steps... All our changes are in this pull-request.

Last week, a new release of the product was made and now you can install it directly using buildout in your Plone site, and have a full Plone site converted to static HTML files in a couple of minutes.

Of course the statification process makes that you lose all dynamic features of Plone: you cannot edit the live site, you cannot use Plone's search features, and you cannot use fancy search products like eea.facetednavigation (unless you program even fancier deployment steps), but it works for a plain Plone site with extra content-types and custom theme. You don't have to do anything strange: add the product in your buildout, check the configuration file, and hit "Deploy" in Plone Control Panel.

Yes, it looks like the Big Green Button imagined by Martin Aspeli in his famous "Pete and Andy try Plone 4" blog post.

Comment

To comment this article you have to log in using your Facebook, Twitter or Google account.