6 ms·
Embrace the Static Web with Punch
- bilalq 14y agoThis seems to be the Node equivalent of Jekyll in Ruby. Pretty awesome!
- charliesome 14y agoThe use of Mustache is a bit off putting. I'd prefer a template language that lets me put all the gory code I like in my templates.
- laktek 14y agoYou have the option of changing the template engine to any one you prefer - https://github.com/laktek/punch/wiki/Adding-a-New-Template-Engine https://github.com/laktek/punch/wiki/Adding-a-New-Template-E... For example, here's a handlebars plugin for Punch - https://github.com/laktek/handlebars https://github.com/laktek/handlebars
- 46Bit 14y agoAs everyone has, I built my own static site generator called Fairytale (https://github.com/46Bit/fairytale https://github.com/46Bit/fairytale). Unlike a lot of them, it wasn't intended as a simple magic-incantation tool: I reimplemented the relevant parts of Sinatra for static-site compilation. You program everything and in development can just use the sinatra gem instead of the fairytale one to get a server. I've been using it on https://46bit.com https://46bit.com for something like a year now, and the thing I've realised is that it's largely a luddite thing. The movement is a rebellion against POS software like Wordpress, but ignores the fact that building a nice, Markdown-driven app with caching and a lovely interface is actually quite easy & friendlier in the long run. It might be great for people afraid of servers, but I'm not. I don't want to be - I'm still serving a bunch of dynamic apps off the same two servers I use for a few static sites, and I enjoy learning how to tune them. I'm planning to transition away from static sites. Initially to just serving a Sinatra app, then later to a custom Padrino or Rails blog engine. Would love to hear if anyone's got any suggestions for something off-the-shelf and hacker friendly in Ruby though.
- bmelton 14y agoI think calling it "a Luddite thing" is perhaps a little overkill. Sure, it's easy enough to scale Wordpress, but I literally won't use 99% of the features that Wordpress offers, and all those features are potential attack vectors. On top of that, with every blog engine / CMS I've ever used (including the ones I'd custom-written), at some point I end up needing to use an iframe with static content because a CMS is only so flexible. Instead of all that, I can put up a static page that is infinitely flexible, use Disqus for comments, and be pretty much free of risk. No database to hack into, no patches to apply, etc. On top of all that, it's even easier than using Wordpress. So, while I don't disagree that there are people using Jekyll and ilk to rebel against Wordpress, an equally valid wonderment would be in trying to figure out how Wordpress got so carried away. Editing to add that your approach is pretty much the same thing I did, but in Django instead of Ruby. I kept using the "CMS"-like methods of Django, but then completely render them out as static pages to be published to S3.
- 46Bit 14y agoYou sum up exactly why I've long since not cared about WordPress, but you seem to assume anything dynamic has to have an admin interface. The ideal engine for me still uses flat files for content, but doesn't compile the files to HTML. Let a cache like Varnish handle the load. That way I can implement things like comments without running off to the latest service-of-the-month that might shut down and take everything with them. I've spent enough time dealing with third-party javascript and issues on their end screwing up the first-party to want no part of a remote comment service.
- bmelton 14y agoSo what's an example of a flat file that isn't HTML? If you have flat files, what value does Varnish provide? If you're accepting use input to write files, then you have vulnerability. I'm not saying you do or don't, but it's an attack vector. As for Disqus, sure, I'm at their whimsy when it comes to security, but they haven't bitten me yet, and I'd hardly consider them fly-by-night as they've been around for years now, and has been profitable since their first year. For what it's worth, I wasn't considering the admin site as vulnerable, as those are generally disabled before deploying, but if you're running a database, or varnish, or Apache, or whatever, your risk is increased for vulnerability, but I suppose that's neither here nor there really, as I think it comes down to a matter of taste and, as you said, I'm trading system vulnerability for third party vulnerability. The upside though is that while sure, somebody could munge my site up, fixing it is just uploading another copy.
- olegp 14y agoI've written something similar in 150 lines of code, if anyone is interested: https://github.com/olegp/mcms https://github.com/olegp/mcms
- dr_win 14y agoHere is a list of static site generators (you should add your own): https://gist.github.com/2254924 https://gist.github.com/2254924 I'm big fan of Jekyll. I use it intensively on my binaryage.com site: https://github.com/binaryage/site https://github.com/binaryage/site I also started working on my own client-side static-site post-processor: https://github.com/darwin/terraform https://github.com/darwin/terraform This is not yet another static site generator. The idea is to have browser-based editor for static site with live preview. Saving your changes would go directly to github, which will trigger site regeneration. Right now I'm waiting for PhantomJS to upgrade internal webkit version. Terraform depends on the new DOMMutationObserver API (resp. on http://code.google.com/p/mutation-summary http://code.google.com/p/mutation-summary).
- orofino 14y agoThis is an interesting idea. I have a wordpress blog and would be very interested to switch to static. However, my wife uses the blog and really needs something more WYSIWYG than markdown. Be sure to share when you've finished.
- bpatrianakos 14y agoAww, I thought I was gonna be the guy who talked about my server-side static site generator first. Haha, anyway, what I like about generating static sites on the server, at least for my situation, is that you can hand over control to anyone and they're immediately familiar with how it works from having used Wordpress or some such for years. I won't like to mine because it's still full of code written for the original use case but mine started as a blog engine for a few of the non-technical people in my department. They needed a blogging engine but because of some stupid beaurocratic reason we couldn't use a database. So the options were to add blog posts manually and fake it, teach them to use Jekyll (that would never happen), or, what I chose, a static site generator on the server that no one would ever think is a static site generator. They love it and think I'm a genius (and it only consists of like 3 files which I think is funny).
- zimbatm 14y agoI really like Middleman for my static websites because of the livereload support: http://middlemanapp.com/ http://middlemanapp.com/
- gallaghersean 14y agoI still prefer LAMP. One trick to improving cache on LAMP is converting or caching files into HTML. I know there are a number of templating engines like Smarty out there that will do just that, but what I mean is actually converting dynamic parts of the site that only change when an admin writes new content. Convert those pages into static HTML files when the admin adds new content, etc. For example, a number of ecommerce website run off shopping cart systems that use a database. Why not have them convert into a HTML version of the site after the admin adds new products, edits products, ect. That would take a huge load off the server and database.
- riledhel 14y agoYou can do that with nginx very easily with the Proxy module. Something like this http://mark.ossdl.de/2009/07/nginx-to-create-static-files-from-dynamic-content/ http://mark.ossdl.de/2009/07/nginx-to-create-static-files-fr...
- 10char 14y agoAnyone have thoughts on deploying static sites to S3? I have a few static sites and single-page JS apps, and right now I just serve them with Nginx off a shared server. I've tried looking for a definitive answer on "Where should I host static sites?" but it hasn't appeared yet.
- scottharveyco 14y agoI have an Octopress site that I generate locally and sync up to S3, this blog outlines how to get it setup. Once you've created the Rake task it's as simple as "rake deploy" and everything is uploaded to S3. http://blog.jacobelder.com/2012/03/deploying-octopress-to-amazon-s3/ http://blog.jacobelder.com/2012/03/deploying-octopress-to-am...
- otibom 14y agohttps://www.nearlyfreespeech.net https://www.nearlyfreespeech.net or even github pages ?
- laktek 14y agoEasiest option would be to use GitHub pages - http://pages.github.com/ http://pages.github.com/ But if you prefer to have more control and availability, you can use S3. Punch makes publishing process to S3 really easy - https://github.com/laktek/punch/wiki/Publishing-a-Site https://github.com/laktek/punch/wiki/Publishing-a-Site
- zrail 14y agoI was just experimenting with it now, actually. If you're willing to accept that you have to use a subdomain it should work fine. Just set up your S3 bucket to host a website, set the index and error documents properly, and set www.yoursite.tld to a CNAME pointing at the website domain S3 generates for you.
- paulgb 14y agoI experimented with S3 but found Rackspace CloudFiles better for my needs. S3 does not serve content compressed, where CloudFiles does. CloudFiles is automatically served through an Akamai CDN, while S3 can be served through CloudFront but needs configuration to do so.
- zerostar07 14y agoThis trend, hosting blogs on static html, is kind of ironic, given how popular it is among developers. I can't make up my mind whether it's some sort of hipsterish-nostalgic thing, a general distrust of running other people's dynamic blog code, or just plain Occam's razor (stick to barebones).
- zrail 14y agoPersonally I wrote my own markdown-rendering static blog because it was something to do. I've stuck with it because I prefer the workflow to a more dynamic application.
- CJefferson 14y agoFor me, it's a way of avoiding having to trust / pay for someone else's server, but also avoid worrying about keeping my wordpress install up to date. I had a little blog I posted to every few months, and one day I found it vandalised from my out of date wordpress.
- paulgb 14y agoI think this is a huge reason for the popularity of static blogs. For dynamic blog software, your choice is basically WordPress. Unfortunately, WordPress has a pretty bad security track record. Things might be different if there were a reliable second-place blogging engine, but as far as I know there isn't. Another reason is the rise of version control for small projects, and the way static sites fit nicely into a Git workflow.
- icebraining 14y agoI use DotClear instead of Wordpress for the blog of a local non-profit, and it's nice, and according to them, easier to manage.
- netnichols 14y agoOn of the main reasons I like static site generators so much is that it makes maintaining a website more like developing software. I have 'sources', which I keep in a Git repo for powerful versioning, I 'build' the website from the sources, and then I 'publish' the final product... which is the user facing HTML website. Developers just find that workflow sublime, and since we're often making websites for ourselves or for our companies, it only makes sense that we've started to use tools that fit our mentality.
- vinodkd 14y agoPreviously on HN about 195 days ago : http://news.ycombinator.com/item?id=3877954 http://news.ycombinator.com/item?id=3877954 But why the repost - I ask? The last time it was arunoda, who seems to be a friend. As somebody who'd love to post a pet project on HN sometime in the hopefully-not-too-distant future, I sorta get that you might want people to try your software and that maybe you'd like more eyeballs than you got the first time around; but couldn't you be explicit about it? I'm sure that something like "Guys, I know this has been posted before, but I'd like you look at it once again" would be more welcome and transparent. Update: I read through the comments on that thread. THAT was a repost. This is the original: https://news.ycombinator.com/item?id=3862269 https://news.ycombinator.com/item?id=3862269 (199 days, poster: you) Whats going on? Have you changed anything since then that you'd like to highlight?
- laktek 14y agoYes. This was not actually a project announcement, but a tutorial published on Appliness. Of course, there had been lot of new features and changes to the process since the initial release. Also, it's up to you to decide whether to vote it to the frontpage or not.
- steveax 14y agoI've gone back to static generators almost exclusively - full circle really as some of my first web pages were generated with Userland Frontier (anyone remember Clay Basket?) nanoc (http://nanoc.stoneship.org/ http://nanoc.stoneship.org/) is currently my tool of choice. WordPress and (popular) plugins are a huge target these days - happy to not be worried about security with static pages. Comments can be handled by Disqus, mobile publishing with dropbox and some plumbing. Certainly not as easy as a "one click install" at a webhost, but fast, scalable and infinitely configurable. Generating feeds in the build process is not difficult either.
- deleted 14y ago[deleted]