

PyGreen – The Simplest Static Web Site Generator Ever For Python Programmers - nicolasvan
http://butterflyprogramming.neoname.eu/pygreen-the-simplest-static-web-site-generator-ever-for-python-programmers/

======
csense
I'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>

~~~
nicolasvan
Nikola 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.

------
qznc
Why 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
I 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.

------
aidos
Whenever 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
You might try Frozen-Flask.

<http://pythonhosted.org/Frozen-Flask/>

------
hkmurakami
There's also Cody Broscious's Benjen framework, if your need is a blog.

<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."_

------
eightyone
Nicolas,

You should consider adding a little more leading to your website's copy to
improve readability.

------
jaredhanson
I 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>

------
cmbaus
This is an interesting everything-old-is-new-again trend. The original Blogger
actually published static web sites over FTP.

~~~
nicolasvan
Yes, 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

      > 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
mod_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
I 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

~~~
nicolasvan
I could not agree more with you. Even if I created Pygreen I would not use it
for big projects. _But_ I know what I'm doing when I create my small web sites
and I know for a simple static web site 'start with html and add dynamic bits'
is just fine. See it as a bash script, it's not meant to be readable nor
reusable. It's quickly created code that serves for one purpose.

I'm the first to say it's quick&dirty. Yet quick&dirty has its advantages in
some cases, even for good programmers that know how to make solid and
maintainable applications.

------
manojlds
> sudo easy_install pygreen

Who uses easy_install these days.

