Skip to content

Instantly share code, notes, and snippets.

@rwmpelstilzchen
Last active December 18, 2015 14:19
Show Gist options
  • Save rwmpelstilzchen/5796179 to your computer and use it in GitHub Desktop.
Save rwmpelstilzchen/5796179 to your computer and use it in GitHub Desktop.
Place a new emailed static Jekyll comment (https://github.com/mpalmer/jekyll-static-comments). A. Put comment.sh somewhere B. Add that line to your .muttrc file C. Make the magic happen by pressing ,c in mutt. This is not minimalist nor elegant, but it works…
macro index,pager ,c "<pipe-message>/path/to/comment.sh<return>" "post Jekyll static comment"
#!/bin/bash
COMMENTSPATH="/path/to/_comments"
formail -I "" > /tmp/comment.yaml
COMMENTID=$(formail -x "post_id" < /tmp/comment.yaml | sed 's/\///g' | sed 's/ //g')
COMMENTDATE=$(formail -x "date" < /tmp/comment.yaml | sed -e 's/^[ \t]*//' | sed 's/ /_/g')
mkdir "$COMMENTSPATH/$COMMENTID"
mv /tmp/comment.yaml "$COMMENTSPATH/$COMMENTID/$COMMENTDATE.yaml"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment