I added a changelog for reviews today. I'd meant to get around to this at some point in the future, when I revisited a review for an update at six months or a year, but someone reminded me of a thing I left out of the WASD review so I made the update and added the feature.
It was pretty easy to implement. I added a hash to the review metadata:
changelog: 2015-10-31: "Fixed some typos" 2015-11-01: "Updated to mention the wrist rest"
… then wrote a partial:
- if page.data.changelog .panel.panel-default .panel-heading %h3.panel-title Updates to This Review .panel-body - page.data.changelog.each do |date,entry| = entry %br %span.small.text-muted = date.strftime("%B %d, %Y") %br // No idea what's going on with the indentation. // Close your eyes and imagine this is // HAML that would compile.
You can see it in the sidebar of any review that's had an entry added (which would be the WASD review at this point).
I thought about doing it by reading Git logs – something I implemented with the docs decomposer – but that would require a level of git hygiene I'm not sure I'm up for. I could have used Middleman's site data stuff to work something out, too. Seemed easier to just keep a log within the review files along with all the other metadata.