Hacker News new | past | comments | ask | show | jobs | submit login
Open-Source Static Site Generators (staticgen.com)
97 points by hihat on May 21, 2014 | hide | past | favorite | 54 comments



I use Nikola. On the tech side the developer decided to model it as a series of tasks such as render photos, render posts, build rss etc. Those tasks are also implemented to run incrementally. For example if you add a new post then only that new post gets rendered to the output directory.

While this sounds fine in principle, it soon gets messy. A configuration change may require everything to be rebuilt. But if you rename or delete a source file it didn't track how that ended up in the output directory so you end up with a slow accumulation of crud. It turns out to be fairly easy to confuse all the incremental logic and end up with messy builds. Add poor decisions like using the datestamp of items in the output directory to build the sitemap (they don't set output directory datestamp to that of the input items) and you get important failings.

In my opinion, incremental builds should give the same results as full clean builds or you have a fragile non-repeatable build - something that is very undesirable. I wrote a bit more at http://www.rogerbinns.com/blog/on-nikola.html


What made you stick with using Nikola? Any good things worth mentioning?


I started with Nikola because of familiarity. I use the Python-centric Sphinx tool for documentation in all my work and personal projects. The primary author of Nikola also wrote rst2pdf which integrates into Sphinx if you also want to build your doc as pdf.

Nikola takes the same approach as Sphinx - for example defaulting to rst content and using conf.py for configuration. It also has reasonably complete functionality like blog posts, regular pages, arbitrary content, galleries, comment system integration etc.

Unfortunately the engineering choices over incremental builds as well as some others (eg choosing javascript/lightbox plugin that doesn't support swiping on mobile even though I pointed to one that worked exceptionally well) means I am on the lookout for an alternative. Worst case I'll probably write something that uses the Nikola file structure but makes better choices.

BTW I used Google+ for a while until they frustrated me by making it harder and harder to actually read content, plus not supporting things like RSS feeds and killing Reader. http://www.rogerbinns.com/blog/all-change.html


> (eg choosing javascript/lightbox plugin that doesn't support swiping on mobile even though I pointed to one that worked exceptionally well)

We don’t force it. You can easily get rid of it in your own theme.

[full disclosure: co-developer of Nikola here.]


How can you ensure that a fresh build on a new machine gives the same result? I can see how you can guarantee the same result in terms of file contents, but not on the file modification timestamp. e.g. if I have access to the last build it is easy to verify whether a configuration change actually resulted in modified output by comparing the file contents, meaning the last modified time can remain unchanged. When building from scratch, surely you have to assume the last modified time is the time of the build. Any thoughts?


A simple approach is to generate output to a temporary file (or memory) and only overwrite the output file if that temp file differs. When no output file exists or they differ, set the timestamp to the newest of the relevant input files.

The problem here is generating a sitemap using timestamps from output files (which are volatile) instead of the input content file. Since it tries to do incremental builds that means there are files already there that it didn't generate with the current build so nothing is known about them other than what can be gleaned from the filesystem.


But my point is on a clean build there is no previous file to compare against.


So you set the output timestamp to the newest of the relevant input files as I mentioned. For example a blog post output file has as input the content file, configuration settings and templates. The output timestamp can be set to the newest of those.

Or the sitemap can use the input files to get the timestamps in which case the timestamps of files in the output directory won't matter. They would affect if-modified-since so it is preferable to have them deterministic.


It would be nice to have a more detailed feature comparison to get some idea of why I should choose one over the other.

I'm currently trying out Pelican just because I'm comfortable with Python and Jinja2 already, but I really have no idea if it's actually the best choice for the kind of site I'm trying to build.


I've been involved in some incredibly large front-end development projects and Middleman was core to our FED workflow. Its a fantastic tool.


I’ve been doing the same—building a fairly large content-based website with around 100 pages for a telecom using Middleman. The site will be live soon, and I hope to be able to share more info about it when that happens.

So far, what I can tell is that Middleman provides a more efficient workflow than the database-driven CMSes I have used in the past.


What does it offer over jekyll?


They're different.

Jekyll has a very simple, convention driven feel to it. Templating is based on Liquid which can be a limitation in some cases.

Middleman feels more like Rails for static sites. Out of the box templates are ERB, which is messier but more flexible than Liquid.

StaticGen.com is built with Middleman, and that made it easy to add a Github extension that would pull in all the repository statistics from Github during the build and make this available to the views.


Jekyll is more blog centric. Middleman is more generic. I have used Middleman for non-blog sites where you just need some simple functionality of templates and partials.


I'm wondering this as well. I've really enjoyed Jekyll in the past and the latest version of Jekyll has support for Sass and CoffeeScript compilation out of the box now (not that it was hard to add before, but nice to just have now). I would also like to know about what Middleman offers.

I must admit, one thing about Middleman that makes me roll my eyes is the use of "Hand-crafted" in the description of the project.


From Middleman's site: "Middleman ships with support for the ERb, Haml, Sass, Scss and CoffeeScript engines." I swap in a middleman-slim plugin, though.


So it seems that Middleman offers very little than the latest version of Jekyll, though I did read someone say Middleman is more focused on pages as opposed to Jekyll being very focused on a blog/posts.


I haven't used the latest version of Jekyll, but from having used older ones, I can say Middleman definitely feels more flexible to me, in terms of how its configured. See my comment elsewhere in this subthread for more color on that.


I've used both, and I got a lot more flexibility and familiarity out of Middleman. It's built as a web application framework that saves all its rendered pages as HTML, so it feels more like setting up a Sinatra app than anything else. I felt like I was fighting Jekyll and its conventions, but merely configuring Middleman and its plugins. Looking at the config file for my personal site, it's got blog stuff, layout variables, helpers, markdown customization, and an asset pipeline all set up with an easy DSL. [1] IOW: use Jekyll for simplicity, use Middleman for control.

[1] https://github.com/icambron/isaaccambron.com/blob/master/con...


A major strength of Middleman over most static site generators (including Jekyll until v2 launched recently) is the ability to generate large numbers of HTML pages from a single YAML (or JSON) array: the sort of thing you'd usually use a database for.

Ironically the folks at Meteor have pushed this approach the most: https://www.discovermeteor.com/blog/three-middleman-hacks-we...


Is there a static site generator with support for multiple authors and multiple languages?

e.g. with archive pages like /<author>/<lang>/<yyyy>/<mm>/ and category pages like /<lang>/<cat>/<subcat>/

I fail to see any. I've tried to configure many of the available generators, but no one seem to have the same itch I have.


My own personal project, Nib [1], could potentially support both requirements. It uses configuration and pipelines, and can generate "virtual" static pages during the pipeline, which currently gets used to generate the blog/article index, tag pages, etc. Shouldn't be too difficult to add the document properties and extend the configuration and templates to match.

https://github.com/jreese/nib


You might want to check out Metalsmith — http://metalsmith.io/ — the archive pages could be pretty easily made using the collections plugin. And if you needed anything custom, the plugins are super easy to write and can manipulate however you choose.


You might look into docpad, then. Jekyll and others are largely built around blogging, but docpad is more of a framework for writing code to generate static sites. It does a much better job of allowing you to do anything you want, porvided you're willing to write some javascript.


Is there any chance that you know a website with docpad (or anything else) that uses the above archive format? I've sample the showcase/example site, but I was not able to identify any.


No, not off the top of my head.

You could probably just arrange your posts in src/documents in this format, and let your layout do a lot of work for you such that each of the files in src/documents/<lang> contains little more than the blog text in its respective language.


I appreciate the answers here. I took a deep look, but it turns out, that every application requires almost the same amount of massaging, especially at the point where my other requirements kick in (category page extra content).

It seems that so far the best approach would be to write a dynamic web app that does what I want, and save the content with wget. Seriously, it seems easier than any of the hackery I need to do.


It’s actually pretty straightforward to create a multilingual Jekyll site: http://developmentseed.org/blog/multilingual-jekyll-sites.

And using something like Prose, multiple non-technical authors can update a Jekyll site: http://prose.io/#about.


In 2004, RosCMS was one of the first open source static site generators with an web CMS.

The ReactOS.org website survived several Slashdot effects with a 500 MHz web server, back 2005 til 2013 (though old server was replaced in ~2007). The website has been translated into more than 27 languages.

http://old.reactos.org/en/roscms.html

Screenshots & video tutorials: http://old.reactos.org/en/tutorial_roscms.html

Source: http://svn.reactos.org/svn/web/tags/RosCMS-3_LastVersion/web... (2009)

RosCMS interface was one of the first AJAX websites back in 2005 - back then GMail still used hidden iFrames to emulate AJAX.

(historical information)


Seriously, who came up with the idea that you should have to scroll down at least one full screen page in order to see just the tiniest bit of actual content?

On the home page - okay, if you need to do so. But why, just why on content subpages? Do you really believe that your purple banner with Roboto is that incredibly beautiful that I want to just stare at it for a minute before scrolling down to the meat, each single time that I click on a link?

"The computer industry is the only industry that's more fashion-driven than women's fashion." Damn, Ellison was so right about that.

Don't get me wrong, I am actually a typographer, and I am the last person on earth who wouldn't value appropriate white space. But ... seriously, find the right balance!


What's the difference with http://staticsitegenerators.net ? Why another one ?


It's the new thing. The recent static site generator explosion left the "market" saturated and overwhelming. More and more people looking to get eyeballs on their work have eschewed the notion of "I'll make an SSG", and instead are saying "I'll make an SSG comparator". However, as this is already becoming a thing, I think I'll spend the holiday weekend creating a site to help you choose an SSG comparator - get ahead of the curve and all.


StaticGen.com has actually been around longer, we just recently relaunched it.

I was thinking of just letting it lapse, but after using staticsitegenerators.net myself, I found I wanted a list that was a bit more strict, in the sense of not including anything that's not a static site generator (flat file CMSs like Kirby or even hosting services like BitBalloon or Fjords).

Also wanted some more details on the list, and there's a lot of potential to do more with a site like this in the future: more meaningful comparisons, guides to picking the right static site generator, etc...

Apart from that it was also just fun to redo the site with Middleman :)


The same might be said for the static site generators themselves :)


It's kind of a relief to see this. At my work, I don't have html files to build, but thousands of config files to build and the solution has been a home grown configuration generator. For us, cluster configuration is a simple binary blob + config, so it's a relief to see that the path I've gone down doesn't appear to be too crazy.


"... on GitHub."


Metalsmith (metalsmith.io) actually uses consolidate.js as a template manager. consolidate.js supports 24 separate template engines (https://github.com/visionmedia/consolidate.js). So Metalsmith's "templates" entry that only lists "Handlebars" is extremely misleading.

I suspect there are other generators on staticgen.com that also use consolidate.js and suffer the same misrepresentation. (I just don't know the other generators well enough to know off the top of my head which ones use consolidate.js.)

Of course, an error such as this makes me doubt all the other information presented on staticgen.com


It's actually explained in the rules. Might be a wrong decision, but we didn't want humongous list of templates for generators that support a library like this. So for all of those we go with the template engine they use by default (whether the default is simply their documentation and examples).

I do think it says something for the philosophy + out of box experience.


Submitted a PR, but wouldn't it be simple to choose "Any" or similar?


PySiteCreator is a small tool I wrote a while ago. It lets you create a web site by writing it in Python.

It's not meant to be a full-fledged static site generator, and has only a few features. I first wrote it as a tool to create wikis programmatically (and hence called it DSLWiki), but then realized that it can be used to create general web sites, so renamed it to PySiteCreator.

Blog post about it:

http://jugad2.blogspot.in/2009/11/early-release-of-pysitecre...

PySiteCreator on Bitbucket:

https://bitbucket.org/vasudevram/pysitecreator


I noticed the list didn't include any static site generators written in PHP, so I googled and found a couple:

* https://sculpin.io/

* http://phrozn.info/


Octopress is a "built out" blogging example built on top of Jekyll. Showing Jekyll (a static site generator) and Octopress (a good example of how to build stuff on top of Jekyll) is a little misleading/confusing.

Splitting hairs maybe...


I've found a lot of these tend to be blog-centric, which seems odd to me considering the primary use case I've found with static site generators (Punch in my case) has been creating one-off content sites for clients in scenarios where we don't need a CMS. Folks seem to be really fixated on building these as blog engines, which I find baffling


It's because these systems were created with the focus being how cool it'd be to make a static site generator, versus the focus being solving a real problem.

We do this. I do this. We like to decide "how cool it'd be..." and do something. There's nothing bad in that, as long as we don't start coming up with invented reasons for its reasons to be.

When asked to quickly name a tool, most people say "hammer". When asked to quickly name a site application, most people think "blog". The focus on blogs inadvertently tells you that these authors were scratching their own itch of making the generator itself, and focused on the first application they could think of, and not responding to real needs. I remember when the coolest thing was for everyone to make their own web framework, everyone focused on making frameworks where blogs were easy to set up and demo. Notice a pattern?

In the end though, all sites need a machine to be put on, a server to serve them, and the arbitrary goal of pre-generating basic things like header and footer includes externally has little real value to offer when it comes to business needs ("business" used in a wide sense, as in people's real reason to have a site in the first place).

Any non-static site can maintain a static cache when performance is needed, and any non-static site can be as simple (and therefore as secure, by function of its complexity alone) as you need it. Maybe your non-static site "engine" can just do basic includes and support a contact form, and nothing else. It's easy to secure this, and you draw the line. But there's no need to ever cross that specific line where your site is 100% static. You have nothing to gain from it.


Using Pelican for almost everything under http://exentriquesolutions.com - have tried Jekyll, but somehow Pelican seems much more pluggable.

Can't recommend Pelican enough - if you're still looking for one, do give Pelican a try: theme support, Jinja templating, plugins and much more.


As I was doing some Rails work anyway I used Rails plus a little bash script and wget to crawl the site which I then deploy. It has it's limitations but I was able to get it all built quite quickly and didn't need to learn any new syntax (I've got the hang of Markdown since so I might do it differently if I did it again).


I don't see any option for C# site generators. Maybe they don't make it into the Top N.

(Disclaimer: I'm biased, I wrote one).


I think it's fine to share a link to it if you acknowledge it as a shameless plug...


A C# generator on the list would be great - do send a pull request!

Or drop a link here :)


I should have looked more closely at the data source. This is well done. I'll send a pull req.


I recommend Blosxom whole-heartedly.


I told my friend he should list his, Zodiac, on there. https://github.com/nuex/zodiac


Heh, I was working on a SSG early last summer for my own stuff in Common Lisp. It's easy to make a bad and overcomplicated one. I know - I did it. :)


I love this. However, it would be interesting to see if you could add other metrics, age of repository, average mailing list posts per week, etc.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: