Static Sites on Heroku
anti-pattern.com
anti-pattern.com
Spinto is Git-based, like Heroku, and uses Jekyll with pre-processors for Sass/Scss (and Compass, Bourbon), Less & CoffeeScript. I agree with Brandon that FTP is hopelessly out of date and frustrating. Even more than that, I think there is madness in the idea that you need a database backend for your website to let somebody else change a comma, or an image (sometimes you need full-blown-CMS, but not always).
I'm trying to make a static websites easier for us to create, deploy, and collaborate on. Feedback _always_ appreciated.
Like some of the commenters here, I looked around for simple static website hosting when I was trying to find a new home for my blog. I considered Heroku, GitHub Pages, and S3. Heroku didn't seem particularly optimized for static hosting (e.g., dyno spin-up time), and GitHub Pages lacked some flexibility (like custom mime types for my extension-less URLs). S3 doesn't handle things like sending gzipped content to only browsers that support it. Ultimately, my cofounder and I decided to build our own solution based on Dropbox: http://www.site44.com.
Site44 is in a private beta now, but we're hoping to move to a public beta very soon. I'd love to get some feedback from HN. The basic idea is that when you create a site (<foo>.site44.com or a custom domain), we create a folder for you in Dropbox, and then you publish by just modifying the contents of that folder.
Github pages support a point-and-click interface (which is not likely what you want) but with a tiny amount of setup supports Jekyll https://help.github.com/articles/using-jekyll-with-pages / Octopress (what I use) http://octopress.org/docs/deploying/github/
Using this technique you can even use .htaccess files.
1. Have public git repo, clone on server
2. Run nginx pointing to htdocs folder in git repo
3. When I want to deploy, ssh in and git pull
Works just fine. Sure, it's a public site on GitHub, but I could just as easily run a git server.
Edit: Oh wow, I didn't realise I could just do this:
git push ssh://example.com/git/repogit@github.com:git/repo.git tells git to SSH using the 'git' user.
heroku create myproject --stack cedar --buildpack https://github.com/pearkes/heroku-buildpack-static
I was also experimenting with a Pelican buildpack (a python Jekyll): https://github.com/pearkes/heroku-buildpack-pelican
You deploy you markdown files and it generates your html in the deploy process.
All you need to do to get them working on heroku is include a super basic config.ru file, and you're all set. The files compile into a public folder which heroku uses to serve them.
- Items can contain arbitrary metadata in nanoc
- You can trivially build multiple representations of a single item in nanoc (e.g. a PDF/txt/html representation of a single markdown file)
- Dependency tracking in nanoc is fully automatic (no need to specify priorities)
- Nanoc is easily extensible using custom filters, custom deployers, custom helpers and more
Statis and nanoc have a different audience. To me, Stasis seems to be aimed at simpler, smaller sites, while nanoc is aimed at much more featureful sites. It is a good thing to have a lot of documentation (nanoc is frequently cited as a good example of how documentation should be handled).
$ cat >>dotcloud.yml <<eof
www:
type: static
$ dotcloud push myapp
$ dotcloud url myapp.www