About Archive Tags RSS Feed

 

Simple website creation tools

29 November 2012 21:50

I host a number of websites which are mostly static in nature, these are often hand-crafted, but three of them us a slightly hacked up creation of my own.

Given a master "template" the file foo.skx gets massaged into foo.html.

Sadly I added features randomly, and now I have three template-driven sites which are handled slightly differently. This put me in the position of having to choose between two options:

  • Unify my template-handling.
  • Use something else.

Simplifying my life is good. So I examined a list of static site generators, and a few more found by searching github.

Other than doing clever things by knowing which page is "current" I needed to do only minimal magic:

  • Conditionally include files.
  • Setup per-page CSS files.
    • e.g. This page and this page differ by the stylesheet used. (And the text content too, clearly!)
  • Setup per-page templates.

Webgen looked like a good fit, but I couldn't get per-page templates to work out. Either they would work, or I would get weird errors about blocks not being known.

Webby worked, but I didn't like it.

Poole was the next one that I got far down the road with, but it allowed only a single site-wide template. Shame because otherwise I loved its flexibility enought to tolerate writing "macros" in Python.

I've still got to test more out, but it is a fun process. I fully intend to adopt an existing tool, and not keep working on my own.

Tonight I'm going to look at a few more.

| 12 comments

 

Comments on this entry

icon pachi at 19:41 on 29 November 2012

I'm using tahchee and has been working fine for me for years. And these days I would also give hyde a try too. Both are projects coded in python.

icon jd at 20:39 on 29 November 2012
http://julien.danjou. info

I use Hyde and I like it.

icon eikenberry at 21:27 on 29 November 2012
http://zhar.net

Keep posting updates please... I've been meaning to replace my hacked up generator with an existing tool as well. So this is very useful. Thanks.

Oh, maybe list the ones you found that aren't on the linked to list. Maybe even report them back to Timo as he asked for people to report new ones so he could update his list.


icon cstamas at 21:58 on 29 November 2012
http://cstamas.hu

And what do you think about ikiwiki?

icon Steve at 22:28 on 29 November 2012
http://steve.org.uk/

I'll update once I've looked at more, and made a choice.

ikiwiki I've not considered because I'm looking to generate a site, rather than a blog. Yes it can be used for sites, I'm sure. But I discounted anything that was blog-centric, or wiki-centric.

As per my requirements I want conditional file inclusion, per-page templates, and pretty much nothing else. If I get per-page template variables, etc, that's a nice bonus.

For example I use this in one of my sites:

Title: The system administration & Automation Tool
#Menu: menu.inc

..

That files the DIV with id="menu" with the contents of the named file, relative to the path of the input file, if it exists.

Something a lot of tools seem to fail on. So many, includng poole, just allow you to replace "page.title", and "page.contents" - there's no notion of replacing arbitrary blocks in the output page unless you use partials or nested templates. Annoying. Ugly. Shame.

icon Leandro Penz at 23:02 on 29 November 2012
http://lpenz.org

I use two setups:
- django and then rip with with wget;
- mako.

icon rjc at 07:51 on 30 November 2012

What about good old WML?

icon Charles Stewart at 08:39 on 30 November 2012
http://www.textproof.com

Isn't your chronicle blog compiler 2/3rds of what you need? Chronicle/rfc822 -style headers seem like they are enough to pass the desired per-page information to HTML::Template.

icon Steve Kemp at 09:06 on 30 November 2012
http://steve.org.uk/

I discounted chronicle for the same reason that I discounted ikiwiki above - but yes, both could probably do the job, though ikiwiki would require less hacking.

Hrn - and after spending last night looking at more tools I realize I have a third requirement:

  • In-place processing.

So many tools take "input/" and write to "output/". I guess that can work if I symlink the two togther. Me? I have .skx/.wgn files in my htdocs directory - simply to avoid having to copy around static files/assets which aren't processed.


icon gabriel at 21:07 on 30 November 2012
http://kergroixnoble.fr/blog/

I manage a french website for a folk association by ikiwiki. It's very pleasant to use and some part may look libre blog but not all !

http://www.folkatp.fr/

icon Thomas Leitner at 15:00 on 2 December 2012
http://webgen.rubyforge.org

webgen meets all your requirements. Furthermore, it also supports multiple content blocks per content file.

Per page templates: just specify a 'template' meta information for the page and make sure that you set the 'template' meta information of template itself to null so that the template does not get nested inside the default template.

As for block being unknown: You may need to look at the additional attributes for the tag.

icon Martin at 12:48 on 3 December 2012

A relatively new, very promising tool is "nikola". The feature list is impressing:

* Creates pure static web pages
* Blog generator, including tags, feeds, archives, comments, etc.
* Theme support
* Fast building process, thanks to doit
* Easy Image Gallery, just drop files in a folder!
* reStructuredText or Markdown as Input languages
* Flexible design
* Small codebase.
* Syntax highlighting for almost any programming language or markup
* Multi-language sites
* Small, since based on leverages existing tools

It uses Twitters bootstrap, and is written in Python:

http://packages.qa.debian.org/n/nikola.html

I did not yet find time to try it out, unfortunately.