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

Rather 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.


Cool. 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?


Nope, 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


Up-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 ?


If 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!


when 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.


Yup. The only problem is with using shorturls (since there no DB object ID to map to).


You 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.


Is this possible on S3?


No 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...


I 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;


(Another solution is to have a directory for each post containing an index html file. I do it that way myself using Jekyll.)




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

Search: