Total Pageviews

Saturday, 1 February 2014

一个基于django1.4的静态博客程序-dynastie

Dynastie is a static blog generator. In facts, it's a Django (1.4) application aimed to generate static blogs.

Why Dynastie ?

There is an uncountable number of static blog generators : it's so simple to build one that anyone want to code it. Previously, I used Joomla, but I found it heavy for something as simple as my blog. The second point is that I wanted to serve compressed static HTML pages because I have a low debit connexion (nginx is perfect for this job). Other criterias were :
  • Not written in Ruby
  • Have a web interface with a WYSIWYG editor
  • Gzip compression of generated output
  • Not using markdown or some other exotic syntax
  • Not using Mako/Jinja/Cheetah (Python template engines)
  • Not using Disqus
  • Be simple
  • Have classic blog features : images, RSS, archives, tags, search, comments...
I didn't found a solution that fit all these requirements and started to code my own in PHP, but quickly found complex without a framework. Then, I tried Django for the first time and was under the charm : quick and simple. Some people says it's a bad copy or RoR, but I don't care, I write Python not Ruby.

How does it works ?

Like other static blog generator, Dynastie merge three types of data to produce the website. Posts are stored (in HTML format) in files, while meta information (comments, tags, category..) are stored in a SQLite database (easy, supports SQL queries and portable). Templates are also stored in HTML format. In facts, Dynastie acts like an XSLT processor to produce the output. I wanted to keep close to the HTML/xml philosophy which is the language of the web. As all is a file, you can easily backup your website and export it to another generator.
The templates are the most opened as possible : there is a only a few variables to use. It let the user design its website as he wants. The main generated files are indexes for index, tag, categories... and RSS/Atom feeds. All file/directory that do not starts with "_" is copied to the output : no need to specify long lists of files/directories.

Eat your own dog food

The best example of all possibilities that offers Dynastie is the output of my own personal blog. It's integrated directly into the sources.

 Features

  • Index in descending order (with published/front page attributes)
  • Categories
  • Tags
  • RSS/Atom feeds (only one by website)
  • Comments (dynamic)
  • Search (dynamic)
  • WYSIWYG editor (on line) with images management
  • Code coloration (using Pygments)
  • Preview
  • Multi blogs
  • User management
  • Content is generated only if necessary.
from http://indefero.soutade.fr/p/dynastie/
http://indefero.soutade.fr/p/dynastie/page/Documentation01/
下载地址: http://indefero.soutade.fr/p/dynastie/downloads/get/dynastie_0.2_dev.tar.bz2