Python 2&3 (optionally static-file generating) Blog App: Because there aren't enough static website generators already in existence that look beautiful using Python/Bottle.
OTHER License
content
and docs
folders under www/blog/ by defaultwww/blog/rss.xml
and referenced in robots.txt to generate sitemap for blogs.pip install -r requirements.txt
cp config.py.example config.py
- this is done automatically the first time app.py is run if the config.py file does not existconfig.py
as neededpython app.py
All the .html files are generated at startup in the www/blog and www/blog/docs folders. The files in www can then be synchronised with your website using a tool like rsync
Because there aren't enough static website generators already in existence that look beautiful.
This is one I created for my personal blog to learn how to build a Python website from scratch. It's a bit of a hack but it does the job perfectly for my needs. For simplicity and ease-of-learning, and following the single-file Bottle design, all of the main web code lives in one file, app.py
Check the TODO.md or ROADMAP.md to see what's left to do and if you make some CHANGES.md I'll be sure to add you to the CREDITS.md and humans.txt files.
Put markdown files in the folder content/ ensuring that your markdown files use a content header:
e.g. content/2015-12-25-xmas.md
- be sure to use the meta information header on each file as shown below
---
date: 2015-04-01 12:56
title: Emil Cioran Quote
tags: [emil cioran, cioran, philosophy, quotes]
---
"I have all the defects of other people, and yet everything they do seems to me inconceivable."
Emil Cioran
Config.data is a dict() of the following configuration values:
'debug': False, # debug mode
'generate': True, # generate static website files
'minify_css': True, # minify css served by webserver (not static files)
'minify_js': True, # minify javascript served by webserver (not static files)
'minify_html': True, # minify all output html including static files
'cache': True, # cache files and output of app
'cache_dir': 'tmp/cache', # default location of cached files
'content_dir': 'content', # default location of .md blog content files
'docs_dir': 'docs', # default location for non-blog .md files
'www_root': 'www', # default location of website root directory
'output_dir': 'www/blog', # default location of webroot for blog
'js_dir': 'www/js', # default location of javascript files
'js_output': 'www/blog/js', # minified js output directory
'js_inline': [] # inline js to compile into page (default:footer) <script>
'css_dir': 'www/css', # default location of css files
'css_output': 'www/blog/css', # minified js output directory
'css_inline': ["normalize.css", "skeleton.css"] # inline css to compile into page (default:header) <style>
'ga_code': 'UA-00000000-1', # google analytics code UA-XXXX-Y
'title': 'Blog', # name of the blog
'author': 'Anonymous', # author of the blog
'email': '[email protected]', # email of author
'url': 'http://www.example.com' # canonical website url
> python manage.py --help
# IMPORTANT
I decided to use the excellent grav for my blog now, so I wrote a script to migrate markdown files from this project to work with grav, run the tograv.php file to convert files from here.