Here’s a quick shell script to get the number of posts in each category for an Octopress blog, just cat your
source/_posts folder through the following one-liner:
1 2 3 4 5
Here’s what each line does:
- extracts the Yaml front-matter from each file;
- extracts each top-level list entry, this assumes that the only top-level list is the category list, which is the default for Octopress posts;
- sort the lines;
- collapse identical lines, prepending a count of the number of lines collapsed; and finally
- sort numerically.
Maybe this will be useful to somebody out there…
Update: I’ve written a version that’s integrated with rake as well.