Mango 0.2 released

Commit 198 has been tagged "0.2". This release adds flexibility in a number of areas, and tweaks existing behaviour in several ways. Creating templates has been made simpler thanks to additions to Mango's common context variables.

Changes since 0.1

  • Improved caching. (Further improvements are planned in this area.)

  • Support for custom post types. Mango provides templates for posts and pages, but things such as podcasts and slideshows are likely to require special treatment. To have a Markdown file rendered by a custom template simply add type: ... to the file's metadata. To specify podcast.dhtml, for example, add type: podcast to the meta section.

  • Updated to version 1.1 of the Disqus API. Note that Mango now requires the updated python-disqus-client.

  • Comment notification e-mail now contains a "respond" link, and the "mark as spam" link has been replaced by a "mark as spam and delete" link.

    Comment notification

  • Each comment now includes its author's IP address, which is useful as Disqus provides the ability to blacklist/whitelist commenters by IP address.

  • The posts directory (or any directory below it) may now contain a file named "foo.text" and a subdirectory named "foo". Previously, the presence of the directory would result in /foo/ rendering the category template rather than the converted contents of foo.text.

    Now, files take precedence which allows the following structure:

    docs/
        templates/
            archives.text
            category.text
            ...
        templates.text
    docs.text
    

    This will be familiar to those who've dealt with static sites in the past.

    docs/
        index.html
        templates/
            index.html
            archives.html
            category.html
            ...
    

    Note that in the structure above there are two files with the meaningless name "index.html". Mango ensures that all files can be named descriptively.

  • The functionality of a Mango site can now be extended more neatly. Previously, the recommended method for adding a new view, say, was to add a new line to the project-level urls.py pointing to the view (saved in a custom views file).

    Django applications should touch the containing project in as few places as possible. With this in mind, Mango now pulls in urlpatterns from settings/custom.py, if this file exists. This allows patterns to be added to match custom views.

  • views.context_defaults now returns a dictionary with two additional entries: archives and posts. archives contains the [(year, month, [posts]), (year, month, [posts]), ...] list named "posts" in 0.1. posts contains a simple ordered list of posts.

    Having access to a flat list is useful as several views had been calling utils.posts and unpacking the tuples to generate such a list.

    Additionally, since both archives and posts have been added to Mango's common context variables, every template has access to this data. This has been used here at mango.io to provide a list of recent posts in the sidebar.

  • New category and tag templates, to allow these pages to be presented differently from the home page.

  • PATH_TO_POSTS and PATH_TO_STATIC may now contain "~" (representing the user's home directory).