レナート   PID EINS!   ﻟﻴﻨﺎﺭﺕ

Thu, 11 Aug 2005

Simplified "Draft" Plugin for pyblosxom

The pyblosxom plugin registry links a plugin which allows hiding "draft" stories before publishing them, so that only you can see them. Unfortunately the link to this plugin is broken. So here's my (simplified) reimplementation:

def cb_prepare(args):
        request = args["request"]
        query = request.getHttp().get('QUERY_STRING', '')

        if not query.endswith("&ignore") and not query == "ignore":
                data = request.getData()
                data["entry_list"] = filter(lambda e: not e.has_key('ignore'), data["entry_list"])

To mark a story as "draft" simply insert this at line #2:

#ignore yes

To browse unpublished stories simply append ?ignore (or &ignore) to your blog URL.

posted at: 21:00 | path: /projects | permanent link to this entry | comments


It should be obvious but in case it isn't: the opinions reflected here are my own. They are not the views of my employer, or Ronald McDonald, or anyone else.

Please note that I take the liberty to delete any comments posted here that I deem inappropriate, off-topic, or insulting. And I excercise this liberty quite agressively. So yes, if you comment here, I might censor you. If you don't want to be censored you are welcome to comment on your own blog instead.


Lennart Poettering <mzoybt (at) 0pointer (dot) net>
Syndicated on Planet GNOME, Planet Fedora, planet.freedesktop.org, Planet Debian Upstream. feed RSS 0.91, RSS 2.0
Archives: 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013

Valid XHTML 1.0 Strict!   Valid CSS!