4 ms·
What's the difference between a static blog generator and something like WP's blog system, or Posterous? Bit confused by the terminology.
by stef25 14y ago
What's the difference between a static blog generator and something like WP's blog system, or Posterous? Bit confused by the terminology.
- daeken 14y agoRather than a web app that runs and serves up content dynamically, this just spits out HTML that your webserver can serve up. No additional surface area for attack, no need for caching to keep things efficient, etc. Super simple.
- stef25 14y agoCool. So there is no DB involved at all for the content? When you edit, the old file is replaced by the a new one? I guess there is a backend you log in to and a wysiwyg for editing?
- daeken 14y agoNope, no DB at all. The way you edit the content is 100% up to you, but at the end of the day, your entries are just Markdown files in a directory. You can see my whole blog setup at https://github.com/daeken/Benjen/tree/master/daeken.com https://github.com/daeken/Benjen/tree/master/daeken.com
- danjessen 14y agoUp-boat and comment for later reading and look thru. I like your idea and I hope it's okay if I borrow some of your concepts for a future idea of mine ?
- kmfrk 14y agoYup. The only problem is with using shorturls (since there no DB object ID to map to).
- daeken 14y agoI get around this with nginx rewrite rules. Since my old blog was Posterous, I spit out a bunch of rewrites to map my old URLs to new ones, e.g.: rewrite ^/superpacking-js-demos$ /2011-08-31_Superpacking_JS_Demos.html;
- kzar 14y ago(Another solution is to have a directory for each post containing an index html file. I do it that way myself using Jekyll.)
- grey-area 14y agoYou could have your static generator create symlinks for each post at the short url pointing to the actual page at the canonical url to handle this, and set your server up to follow symlinks. Alternatively it could generate a table of redirects for you to put in your server config/htaccess.
- kmfrk 14y agoIs this possible on S3?
- grey-area 14y agoNo idea I'm afraid, it depends on their setup. I used it as one approach when generating a static blog a while ago under Apache, but there are plenty of options (using config redirects, using symlinked pages or dirs, using duplicate html pages with rel=canonical, using js redirects in extra html pages), and I'm sure some if not all of them would work on S3. As long as you're generating statically anyway, you can always add another step to generate all your short links automatically too in whatever form works on your server...
- the1 14y agowhen you edit an article file, you also want to regenerate index, sitemap, rss feed, ... etc. or any pages that depend on the modified article. when you edit a template or configuration, you need to regenerate entire site. even if you blog very often, say 10 times a day, in 10 years, you only have 36k articles. Probably it shouldn't take too long to regenerate entire site for any kind of modification or addition of pages. or, you can try to be smart and draw dependency graph (maybe using Makefile) and update what's only needed. basically you're solving caching problem, one of the hardest thing in programming.
- Vivtek 14y agoIf you don't mind a local backend that you access on the command line, you can host the blog itself (or any static site) directly on Github with no further ado. I recently moved my since-1997 site Vivtek.com to Github and freaking love it. It's never down, no matter how much I neglect my active server!
- charliepark 14y agoGenerally, a typical blogging engine is made up of templates, your database of entries, and some sort of logic that stitches them together on the fly when a visitor hits your website. A static blog is run through a processor once, and plain html pages are generated and stored on the server. When a visitor requests a page, they're served one of those static pages. WordPress has caching plugins that allow your blog to serve static pages (helpful when traffic surges and your database might be overwhelmed), but, by default, a WordPress blog serves content dynamically (meaning it isn't cached).