Listing Published Octopress Posts
Published: 2012-01-24 08:01:00 -0500
In converting my blog from Wordpress to Octopress, I had a lot of old posts I was leaving unpublished. I wanted to keep them around but don’t see the need to republish them right now. I also want to be able to create a lot of drafts of ideas and leave them unpublished. Then whenever I’m ready to work on a post, they’re all right there in my repository already.
Problem is that I find it hard to read through the filenames of posts and try to
remember which have been published and which have not. So in order to see
the publication status of all my posts, I created this rake task. I just
dropped this at the end of Rakefile
and run rake listpub
.
When posts have published: false
in the YAML front matter, they get no
asterisk. All other posts get an asterisk as they either have no published
field and so are published
by default, or set explicitly to true with published: true
.
The method of extracting the YAML front matter from the post with a regular expression is taken from Jekyll.
Here’s some partial output showing two published posts and one unpublished:
What other tasks would help you manage drafts and publication workflow for your blog?