6 ms·
PyGreen – The Simplest Static Web Site Generator Ever For Python Programmers
- csense 13y agoI've been looking for a blogging-focused static website generator in Python. Nikola [1] is the best I've found so far. [1] https://github.com/ralsina/nikola https://github.com/ralsina/nikola
- tbatterii 13y agoagreed nikola is pretty sweet. I had to write my own because I was bored. it's a good intermediate level exercise that everyone should do at least once. Like phpers writing template engines. :)
- whitehat2k9 13y agoFrom first glance this appears much better than Pelican...
- nicolasvan 13y agoNikola is very similar to Jekyll or nanoc. Everything is declarative, you're limited to the features implementented in the generator (and to the features that are documented). That's really not the same thing than the quick&dirty, code-what-you-need approach of PyGreen.
- jaredhanson 13y agoI like this trend of making ever-more simple static site generators. To promote my own project, check out Kerouac [1] if you prefer your tooling to be in Node.js. [1] https://github.com/jaredhanson/kerouac https://github.com/jaredhanson/kerouac
- aidos 13y agoWhenever I find myself making a static site I create it in flask and them wget over it to convert to HTML. Normally I push to s3 so it would probably make sense to put a layer in to self publish using boto. Building in a simple framework and pushing to static is a great way to create a solid and cost effective site.
- fixxer 13y agoYou might try Frozen-Flask. http://pythonhosted.org/Frozen-Flask/ http://pythonhosted.org/Frozen-Flask/
- nicolasvan 13y agoThat's what I did too. And it's true there is no better way to get exactly what you need. Plus if you know your tools correctly you can be very productive with it. I created PyGreen to be able to do the same thing but with an even faster startup. With it I don't need to create a base setup or copy-paste an old one. I just begin to work on the home page and exporting the style of the web site in a template takes like 10 seconds. And that's it, I spent 10 seconds on the coding of my website and I can use pygreen gen to get my static version to push on github pages. Later, if I want, I can ditch the static version and add dynamic web pages. PyGreen does not use declarative markdown files, there is nothing that prevents you from adding completely dynamic stuff in the templates. It also uses Bottle, which is almost the same as Flask. So I can just add routes to Bottle and anything dynamic I could need then publish my app on a small server.
- hkmurakami 13y agoThere's also Cody Broscious's Benjen framework, if your need is a blog. https://github.com/daeken/Benjen https://github.com/daeken/Benjen "Benjen is a tiny static blog generator. At its heart is a <100 line Python script, which takes in your templates and blog entries and produces a static site."
- cmbaus 13y agoThis is an interesting everything-old-is-new-again trend. The original Blogger actually published static web sites over FTP.
- nicolasvan 13y agoYes, of course, who didn't :). That was the way to learn html in the nineties. No, seriously, if you want to compare with an old stuff compare with PHP because that's precisely what I copied. But as far as I know there was no other project that ported that quick&dirty approach to Python.
- stock_toaster 13y ago> if you want to compare with an old stuff compare with PHP because that's precisely what I copied. But as far as I know there was no other project that ported that quick&dirty approach to Python. mod_python has been around for something like 13 years.
- sirclueless 13y agomod_python is more like CGI than PHP. What was missing was reversing the whole paradigm from "Start with a programming language, and add HTML generation" to "Start with an HTML page, and add little dynamic bits" which is what PHP did so amazingly well that it is still more or less the top server-side programming language despite its many deep flaws.
- stock_toaster 13y agoI was speaking more of the PSP[1] (python server pages) component of mod_python, but I guess that component was released later in 2004[2]. Note: I make no recommendation for its usage. I personally consider 'start with html and add dynamic bits', for anything beyond the trivial, as an anti-pattern. [1]: http://www.modpython.org/live/current/doc-html/pyapi-psp.html [2]: https://en.wikipedia.org/wiki/Python_Server_Pages
- eightyone 13y agoNicolas, You should consider adding a little more leading to your website's copy to improve readability.
- manojlds 13y ago> sudo easy_install pygreen Who uses easy_install these days.
- qznc 13y agoWhy does everyone claim to be the "most simple" static website generator? Then they list their few dependencies like "web framework foo". My idea of "most simple" would be something like this: #!/bin/bash for f in *.mdwn do pandoc "$f" -o "${f%.*}.html" --standalone done A bash script with a loop plus one command to convert a markdown file into a HTML file. You might choose something different than pandoc. Most likely you will have an executable called "markdown*" in your $PATH.
- andrewflnr 13y agoI wrote a command line program that evaluates jinja2 templates (jinjafy.py), and then a script that filters a directory of html files through it, copying any other files. Works ok so far.