Simplified "Draft" Plugin for pyblosxom

The pyblosxom plugin registry links a plugin (http://pyblosxom.sourceforge.net/blog/registry/authentication/draft) which allows hiding "draft" stories before publishing them, so that only you can see

The pyblosxom plugin registry links a plugin (http://pyblosxom.sourceforge.net/blog/registry/authentication/draft) 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.

No comments yet.