News for hackers. Stuff that matters.
Re:Show HN: Super simple static blog generator, Benjen by daeken on Sunday March 17, 2013 @07:46AM (#5388902)
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.
Re:Show HN: Super simple static blog generator, Benjen by stef25 on Sunday March 17, 2013 @07:56AM (#5388925)
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?
Re:Show HN: Super simple static blog generator, Benjen by daeken on Sunday March 17, 2013 @07:57AM (#5388931)
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
Re:Show HN: Super simple static blog generator, Benjen by danjessen on Tuesday March 19, 2013 @05:31AM (#5399789)
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 ?

Re:Show HN: Super simple static blog generator, Benjen by Vivtek on Sunday March 17, 2013 @09:12AM (#5389068)
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!
Re:Show HN: Super simple static blog generator, Benjen by the1 on Sunday March 17, 2013 @08:20AM (#5388988)
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.

Re:Show HN: Super simple static blog generator, Benjen by kmfrk on Sunday March 17, 2013 @08:09AM (#5388962)
Yup. The only problem is with using shorturls (since there no DB object ID to map to).
Re:Show HN: Super simple static blog generator, Benjen by grey-area on Sunday March 17, 2013 @08:22AM (#5388990)
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.

Re:Show HN: Super simple static blog generator, Benjen by kmfrk on Sunday March 17, 2013 @08:42AM (#5389028)
Is this possible on S3?
Re:Show HN: Super simple static blog generator, Benjen by grey-area on Sunday March 17, 2013 @09:00AM (#5389053)
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...
Re:Show HN: Super simple static blog generator, Benjen by daeken on Sunday March 17, 2013 @08:10AM (#5388971)
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;
Re:Show HN: Super simple static blog generator, Benjen by kzar on Sunday March 17, 2013 @08:24AM (#5388994)
(Another solution is to have a directory for each post containing an index html file. I do it that way myself using Jekyll.)