A light dynamic blog server powered by bottle, sqlite and mistune, written in python.
- Render markdown to HTML
- Build directories automatically
- Easy to post, update, delete articles
- Comment support (and quote)
- All in python (web-framework, database and markdown renender).
- Python3 only!! (which sqlite is buildin)
Depend on the following python modules
- bottle (framework)
- bottle_sqlite (sqlite database plugin)
- mistune (markdown renderer)
These three module files have been copied to project dirctory, so all you need is python3.
-
Prepare your documents
Organise your markdown file and images in categories, and put them in/docs
folder. It should like this:|---docs | |---category_1 | | |---passage_1 | | | |------passage_name.md | | | |------image1 | | | |------image2 | | | | . | | | | . | | | | . | | | | | |---passage_2 | | | . | | | . | | | . | | | |---category_2 | | . | | . | | .
category_n
will be the category name
passage_name
will be the passage title(underline will be replaced by whitespace) -
Initialization
In project directory, runpython gentool.py init
This will create several table in database, render md file and save the result in database, relink and rename the image, then put them in the
/static
folder. -
Run the server
python server.py
To add, delete or modify, just change the categories and files in /docs
folder and run one of the following command:
./gentool.py update_category
./gentool.py update_article
./gentool.py update_all
Any of this command will update the database according to the content in /docs
folder. But won't delete anything in database that has been deleted in /docs
folder. However, you can specify arguement delete
to delete them.