September 2012 Archives

Sorry I can't dance, I'm holding on to my friend's purse

Don't you love static web sites? So easy to deploy, so intrinsically safe... On the other hand, writing all your HTML by hand, like in 1994 (before server-side includes, for example) is rather painful.

Of course there are tools like Jekyll, but they kind of force you to adopt their conventions when you write your site.

What I'd really love to do, is to write my web site using one of those nice web frameworks we have now, update the data in there using all the nice tools they provide, and then generate the static version of the site to deploy. Most the fancy "dynamic" stuff can be handled with JavaScript on the browser.

This is what wallflower does. Given a list of URL and a Plack application, it will save all those URL into a set of files, ready to be uploaded.

Some advantages to this approach:

  • works with any Plack application
  • all the data entry can be done offline, running plackup myapp.psgi (or whatever your web framework offers) on your laptop
  • no need to setup a web server to generate the data
  • no network involved: it's faster than wget -m
  • publishing is as easy as ./generate_urls | wallflower -a myapp.psgi -d output && git commit -m "Site update" && git push

The next step is to pick all the local links from the pages, to crawl the whole website from a limited set of starting points. This is on my TODO list.

Try it!

About BooK

user-pic Pink.