6 ms·
A static website generator in Python
- nXqd 14y agowhat is the application he uses to copy amazon key in the screencast : http://vimeo.com/46999791 http://vimeo.com/46999791
- mattwidmann 14y agoLaunchBar at http://www.obdev.at/products/launchbar/index.html http://www.obdev.at/products/launchbar/index.html
- jokull 14y agoI have a weird approach to this problem that someone might like. I use Brunch, which is a frontend assembler (like Yeoman but with more flexibility). I then use a Jinja2 watcher utility over the output directory. So one watcher does Stylus>CSS, Coffee>JS, minifying, concat etc., and the other one is for the template stuff. I wrote a simple utility for the templating part, which can output site translations too if you want. https://github.com/jokull/jinjet https://github.com/jokull/jinjet Warning: Not good for blogging or anything you would like to update often. I’ve also tried Flask-Freezer for static sites. All the benefits of regular frameworks. Cactus has some nice things going for it, but some decisions are weird. May I suggest using Jinja2 for templating, Django is complete overkill and simply an inferior template engine. Oh and make it at least somewhat PEP8 compatible.
- akavlie 14y agoIt would be great if someone (esp. the generator's authors or users) could comment on how this is different than the other Pythyon static site generators, such as Pelican. Based on the docs, it appears that it's built with easy deployment to S3 in mind.
- koenbok 14y agoAuthor here. I haven't looked too much at Pelican, but Cactus was built for designers (eg. be simple). The goal was to get them from nothing to a fully hosted site on s3 in under a minute.
- jordanmessina 14y agoNice work. I really like the simple deployment aspect. I've been working on a static site generator as well, but with a twist. My issue has always been having to learn a brand new framework and set of commands to simply generate a static site. I already know Django very well, so I built a static site generator on top of it. I just use the Django test client (https://docs.djangoproject.com/en/dev/topics/testing/#module-django.test.client https://docs.djangoproject.com/en/dev/topics/testing/#module...) to dump the static content to a folder. I have some markdown helpers too, so all posts can be written in markdown and live in some folder at the root of the project. I have a few more things to finish with it, if anyone's interested I can throw it on Github.
- mrhonza 14y agoHere is my static site generator in Python: socrates. http://honza.ca/socrates/ http://honza.ca/socrates/ Jinja2 templates; write in md, rst, textile; sphinx syntax highlighting; yaml config; compatible with s3 and github pages; atom feed.
- thurloat 14y agoI converted my WP hosted blog over to socrates last year. Very familiar and enjoyable environment being someone who does python, and served up using GitHub pages. :)
- danjessen 14y agoLooks good i might have to check it out
- JeffJenkins 14y agoI've been very happily using Blogofile. It's what Mike Bayer uses for SQLAlchemy. There's a built in blog engine, and it uses Mako templates, which are significantly better than the django ones. It also by default will recognize multiple formats (e.g. markdown, mako, plain html) for rendering and you can embed markdown inside of the mako templates. And vaporfile works pretty well for uploading the finished site to S3: https://github.com/enigmacurry/vaporfile https://github.com/enigmacurry/vaporfile
- danso 14y agoHow's this compare to Ruby's Jekyll and Octopress? I think static site generators are pretty great...especially if you have a decent grasp of JS frameworks. According to the recent HN front page submission, Obama's $250 million fundraising site was run off of Jekyll.
- wting 14y agoI used Jekyll up until 7 months ago before switching to Pelican and blogged about it here: http://blog.williamting.com/posts/2012/05/30/migrating-from-jekyll-to-pelican/ http://blog.williamting.com/posts/2012/05/30/migrating-from-... tldr: Wanted to mess around with internals, but rather than learn Ruby I switched to a Python-based platform instead. I've learned Ruby since then, but only at a surface level of comprehension.
- SnowLprd 14y agoI did some due diligence on static site generators at the beginning of the year, first writing down my desired attributes: * Actively maintained * Supports Markdown * Written in Python * Flexible templating system * Supports RSS/Atom feeds * Supports syntax highlighting * Track history (been around for at least a year) The above list seemed like a good place to start, and after going through all the various candidates, the one that met all my criteria was Pelican. I liked the project and its author enough to eventually join the team as a committer. Check it out at: http://getpelican.com/ http://getpelican.com/ Cactus looks interesting, but I prefer having a wider range of deployment targets (instead of just S3). I also prefer the Jinja templates that Pelican uses instead of Cactus' Django templates. Just my two cents, of course. All of the various static site generators bring something interesting to the table — the more the merrier!
- Pfhreak 14y agoHave you looked at wok? https://github.com/mythmon/wok https://github.com/mythmon/wok
- SnowLprd 14y agoI did — it was on my original list of candidates. At the time, it was brand new and didn't have the track history I was looking for. The world is littered with DIY publishing tools that are abandoned soon after they're announced, and I wanted to tie my wagon to a project with a dedicated maintainer. Now that time has passed, and Wok seems to have been updated regularly over that time period, it does indeed seem like it's worth a second look.
- laktek 14y agoHave you tried Punch? http://laktek.github.com/punch http://laktek.github.com/punch. (and yes, I'm the creator). It will fit into all your requirements and has been there for almost a year now.
- antrix 14y ago> * Written in Python Isn't punch a nodejs app?
- spitfire 14y agoDo any of these static site generators support A/B testing (probably via some JS)? That's the real thing that I see missing in a lot of CMS's. If I could setup A/B tests right in markdown and easily post the results somewhere(A bit tricksy, yes), that would simplify operations hugely for a great many people.
- urlwolf 14y agoAgreed. This would be a killer feature. Right now the options you have is to do everything server side (say django-lean) or use one of the commercial options (optimizely). Not ideal. My money on the static site generator race is on docPad.
- gwern 14y agoThe most painful part is that you used to be able to use Google Website Optimizer as a static-site-wide a/b tester. I was doing just that on my own (Hakyll-generated) site, gwern.net, and half-way through Google shut it down, and replaced it with some crippled thing in Google Analytics.
- laktek 14y agoYou can create two different versions of a page and use something like Google Website Optimizer right?
- troymc 14y agoWhy not use Optimizely? Just add one line of HTML your <head> and you're good to go. (It loads some JS.) https://www.optimizely.com/ https://www.optimizely.com/
- sdoering 14y agoWell, what about Genetify (https://github.com/gregdingle/genetify/wiki https://github.com/gregdingle/genetify/wiki)? I tried it once and it was quite interesting... easy to setup and really easy to use. Just my two cents...
- semenko 14y agoJust a general plug for the Flask framework: http://flask.pocoo.org/ http://flask.pocoo.org/ A lot of you are probably familiar with Flask and its awesome Jinja2 templating system. There's a well supported, officially approved extension called Frozen-Flask that generates static sites from a Flask/Jinja2 deployment: http://packages.python.org/Frozen-Flask/ http://packages.python.org/Frozen-Flask/
- alsocasey 14y agoAssuming one were looking to create a simple static file from scratch (e.g. a personal blog), why would one select Frozen-Flask over a traditional static site engine? If you are familiar with building sites with Flask, I can obviously see the appeal, but for someone unfamiliar with Flask, is there any advantage to going the Frozen-Flask route over simply using a static site generator and content stored as flat markdown? One of the selling points of static sites for me was not having to include a database layer for something as simple as a personal blog with a few dozen entries that I wish to serve.
- smackay 14y agoIt's probably worthwhile to point out the distinction between general frameworks for static page generation and those that are designed for blogs. Overall the supported features are similar with the only difference being the amount of code that needs to be written and how opinionated the framework is regarding the project structure. This latter point pretty much defines whether a particular framework will work for your project. I have a static site, which is published in two languages, currently with over 5000 pages and about 50 page updates and new pages added per day. None of the static blog frameworks were flexible enough even though my requirements are pretty minimal. I ended up using https://github.com/mtigas/django-medusa/ https://github.com/mtigas/django-medusa/ with a custom app, https://github.com/StuartMacKay/django-sitepaths https://github.com/StuartMacKay/django-sitepaths to manage all the pages and allow pages to be easily regenerated. This works well, with little tinkering to keep it working however I'd certainly take a closer look at Frozen-Flask for my next project.
- koenbok 14y agoHere is a simple example project for a blog: https://github.com/koenbok/CactusBlog https://github.com/koenbok/CactusBlog
- zobzu 14y agoThe major problem with all static generators is that, by design, they can't host comments. And using a 3rd party source for comments ain't exactly what I'd be looking for (self-contained) The minor problem is that all the ones I used so far are a lot more complex to use that dynamic generators, for some reason. (Even thus I write templates, css, etc for the dynamic ones as well). It seems like a "it has to be complex" syndrome :p
- jwandborg 14y ago> The major problem with all static generators is that, by design, they can't host comments. And using a 3rd party source for comments ain't exactly what I'd be looking for (self-contained) I have initiated work on talkatv (http://talka.tv http://talka.tv). It's written in Python using Flask. You might find it useful and I hope you'll be able to help me expand it, since I havent found much time to do so myself.
- zobzu 14y agoThat's interesting, and would gain from being more well known :) I hope to have time to give it a try as well. Thanks!
- sdoering 14y agoThat's interesting. I once (some time ago) tried juvia (https://github.com/phusion/juvia https://github.com/phusion/juvia), as comments are a problem for me, 'cause I try to be as much self-contained, as I can be. But on my host, it was not that easy to setup, and I am not that much of a rails guy. So a python-based alternative might fit me better. I'll have a look.
- DanBC 14y ago> The major problem with all static generators is that, by design, they can't host comments. Very few sites are enhanced by allowing people to leave comments. I don't go to YouTube for the comments. I agree at the sub-optimality of third party comment hosting. Maybe a solution is to encourage better discussion on aggregators, and better aggregators?
- 14y ago
- shazow 14y agoI also published my own static website generator. (Excuse my albeit-related shameless plug.) https://github.com/shazow/composer https://github.com/shazow/composer Composer is framework for building your own static site generator. It's not opinionated about what kind of website you want, or which templates you want to use, or what kind of pre/post processing you want to do, etc. For example, shazow.net is composed by pulling metadata from a git repo and using author/timestamps those as variables in each Mako template container for Markdown+Pygments processed text. Composer comes with a bunch of pre-built filters for convenience (Mako, Markdown, Jinja2, RST, Pygments—adding your own is bordering trivial), a site compiler and auto-reloading server, and some other reusable components. If you're interested in doing something completely custom, this might be a good starting point. I haven't worked on it in several months but I like the core philosophy and design—I think others might too. Forks and pull requests welcome.
- peterjmag 14y agoNot to beat a dead horse with yet another recommendation, but here's what I'm using for my own site: https://github.com/Ceasar/staticjinja https://github.com/Ceasar/staticjinja Very simple, but perfect for my needs. Granted, I haven't added a blog yet, but it looks like it'll be pretty easy when I get around it it.
- unoti 14y agoI'd like to see a static site generator that still runs some kind of administrative backend somewhere. Then I could have clients or friends I do sites for log in to one of my personal machines and enter new stories/content, and it would generate the pages and push the updates. That would combine the best of a simple CMS with the best of static generation. Does something like this already exist?
- smacktoward 14y agoYes. It's called Movable Type. http://www.movabletype.org/download.html http://www.movabletype.org/download.html If you wait long enough, everything old becomes new again :D
- hardik988 14y agoI personally use Jekyll for my own blog - because I spent a lot of hours setting it up, and now it just works. However, for my homepage[0], I use Asciiweb[1], a - As a fan of ASCII art, I'm really happy with it. It's great for a static homepage, though not that great for blogging. It uses a custom markup language that supports a couple of great features: optional per-page configuration, executing scripts through a nifty <exec> tag, and the script's output is placed in the web page. I use this to run a BSD fortune script[2]! [0]: http://www.hardikr.com http://www.hardikr.com [1]: http://tastytronic.net/asciiweb/aw.cgi http://tastytronic.net/asciiweb/aw.cgi [2]: http://www.hardikr.com/aw.cgi?main=fortune.rfk http://www.hardikr.com/aw.cgi?main=fortune.rfk
- human_error 14y agoDo we really need another one? What's the point of creating these static website generators in Python?