Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Is ther any CMS/blog/... type of thing that would create flat files, but keep all the content also in DB?

That way search and comments (and especially moderation for comments) would be easier to handle, but still it would be easy on the server.

For my own site I created something like this, https://github.com/Harri/Spage , but instead of DB, I used another set of flat files (serialized arrays containing the page content + some meta data) for management purposes.



> Is ther any CMS/blog/... type of thing that would create flat files, but keep all the content also in DB?

Both Drupal and Wordpress have modules/plugins that produce static pages:

* Drupal: https://drupal.org/project/boost

* Wordpress: https://wordpress.org/plugins/wp-super-cache/

They're both quite mature and the standard practice for websites that get a lot of anonymous traffic using their respective CMSes.

An alternative (or supplement) to them would be something like Varnish: https://www.varnish-cache.org


There is also a WordPress plugin for generating static pages to upload later, but it's got a lot of gotchas and doesn't seem to have been updated recently. I'm using on my site.

http://leonstafford.com/wordpress-static-html-output-plugin/


Usually that can be achieved with a cache like Varnish. One of the biggest benefits of static site generators is that the only software you need on your server is a web server. As soon as you want to start adding things like search and comments, you lose that benefit.


You can use third party tools for both search (e.g. google site search) and comments (e.g. discus). Of course, if you want to customize things further with user-supplied content, at some point you'll need a dynamic backend.


I hacked up a simple commenting system for my static site, modelled after disqus but far less featureful:

http://github.com/skx/e-comments/

As used on http://tweaked.io/


I wrote a very rudimentary Django module which does that:

https://github.com/stucchio/Stiletto

No idea if it works with the latest django, I haven't used it since roughly 1.4.


DocPad is a little more involved to get running, but does something like what you're describing: https://github.com/bevry/docpad


I've been hacking on Spontaneous CMS for a couple of years now:

http://spontaneous.io

It renders to static files by default (as well as compiling+compressing assets etc) and you can define any number of separate outputs in multiple formats (e.g. HTML, JSON, Javascript, XML, RSS etc) which will also be rendered at the same time.

Plus a whole world of other features, some I consider to be relatively revolutionary. </IMHO>

It works well but lacks, (really, really seriously) lacks, documentation.


I am currently building a static-file blogging system based on Prismic.io and Middleman. It's going pretty well.

The hardest part is that we are going to have a build server that rebuilds the stale parts of the site every hour or so - I don't think that's been done with Middleman before, so we're building that from scratch.

I'll post the details on https://tech.bellycard.com when we're done with it.


Caching has killed the need for SSG's for the most part. You can cache Drupal or Wordpress or pretty much anything with either plugins/modules or via a proxy like Varnish. These things work, generally, by copying the dynamic page and serving up a static page until they detect the page has changed or the user is requesting dynamic functionality (trying to post a comment, log in, etc).

So you get the best of both worlds.


I interpret the groundswell interest in the SSG a testament the CMS does not address all the needs in the content publication pipeline. Some organizations have a focus on content creators. Others on developers. In general, the hacker mindset has an allergy towards ecosystems that remove control. The SSG is about providing a framework for the developer to assert control and regaining flexibility to deliver content independent of coding to a "system".

The CMS is a crutch. It has its place in certain organizations. But it is overkill for many use cases.

In truth, however, we shouldn't be pitting the SSG against the CMS. I believe the next leap of content creation is a mixture of both SSG and classical CMS. Check out the following links:

https://github.com/thyb/contentify https://www.contentful.com/ https://prismic.io/

There is a convergence about to happen between "dynamic" content and the SSG. It could be called CMS as an API.


Unless you want to host a site for peanuts on S3...


Movable Type does this.


Moveable Type was the first blog system I used, over 12 years ago. Oh the memories... my first exposure to Perl and setting up sites on a shared host. Slacking off in university labs to tweak the theme files/write posts/work out why site rebuilds were taking a stupidly long amount of time... fun times :)


Is there anything more modern that also does this (generates flat files from a database that can then be uploaded/served statically)?



Fog Creek City Desk used to do this - 10 years or so ago.




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

Search: