This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

django-staticblog is a markdown-based blog system for Django that compiles to static html.

Requirements

django-staticblog requires:

  • Python 2.6+
  • Django 1.4+
  • markdown
  • html2text

Installation

pip install django-staticblog

or

python setup.py install

after checking out the code from http://github.com/cgrice/django-staticblog

Add staticblog to your INSTALLED_APPS setting, and add

url(r'^preview/', include('staticblog.urls'))

to your urls.py

Configuration Options

STATICBLOG_ROOT - root directory of your django project

STATICBLOG_POST_DIRECTORY - full path to the directory which holds your blog posts in markdown format. Defaults to your STATICBLOG_ROOT + '/posts'

STATICBLOG_COMPILE_DIRECTORY - full path to the directory which will hold compiled post and archive html pages. Defaults to MEDIA_ROOT + '/posts'

STATICBLOG_STORAGE - Defines how staticblog stores images defined in blog posts. Defaults to DEFAULT_FILE_STORAGE.

Usage

To start using staticblog, write some posts in your STATICBLOG_POST_DIRECTORY. These posts should be formatted in markdown. Post filenames should contain alphanumeric characters and dashes only, and end with .post. For examples, please see the examples folder in this repository.

Each post can also contain metadata used for title tags and post information. For example:

Title: Look, I'm blogging!
Summary: A concise summary of a post
Author: John Doe
Date: 2009-08-05 11:25:53 GMT

You can include remotely hosted images in your posts - these will automatically be downloaded and stored in the location defined by STATICBLOG_STORAGE.

To include local files, create a folder with the same name as your post file, minus the .post extension. You can then add image files to this folder, and reference them in your markdown like so:

![Alt Text](post-name/image.jpg)

Compiling Posts

To display your posts, you need to compile them. To do this, staticblog provides a management command named update_blog. By defult, this command will process all new blog posts, handle their images, and create a folder in your STATICBLOG_COMPILE_DIRECTORY with the post name, with an index.html file containing the blog post.

update_blog also creates a post listing, which it stores in an index.html file in your STATICBLOG_COMPILE_DIRECTORY.

update_blog takes two optional arguments:

--all - process all blog posts regardless of whether they already exist --name=POST,POST2 - process a list of blog posts by post name

Templates

staticblog provides two default templates - staticblog/post.html and staticblog/archive.html. You can overwrite these in your own template directory to integrate the posts with your site.

Template Variables

staticblog/post.html

  • post : a dict containing:
    • content : blog content in html format
    • title
    • date
    • author
    • summary

staticblog/archive.html

  • posts : a list of post dicts as defined in post.html above

Changelog

0.2.5 - 2012-10-16

  • Bugfixes for setup.py

0.2.4 - 2012-10-16

  • URL for rendering posts is no longer hardcoded to ‘/preview’
  • Added view to handle github post-receives and render blog
Release History

Release History

0.2.5

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django_staticblog-0.2.5-py2.6.egg (30.9 kB) Copy SHA256 Checksum SHA256 2.6 Egg Oct 16, 2012
django-staticblog-0.2.5.tar.gz (6.9 kB) Copy SHA256 Checksum SHA256 Source Oct 16, 2012

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting