Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2015
What would you like to do?
Create Jekyll post from Emacs
(defun tpanum/create-jekyll-post
"Creates a new buffer and file for a blog post"
(interactive "sTitle of blog post: ")
(format-time-string "%Y-%m-%d-")
(replace-regexp-in-string " " "-"
(replace-regexp-in-string "[^0-9a-zA-Z ]" "" title))))))
(generate-new-buffer filename))
(mapconcat 'identity
'("---" "layout: post")
"\n" "title: '" title "'\n" "date: '"
(format-time-string "%Y-%m-%d %H:%M:%S %z")
"'\n" "---\n"))
(boundp 'blog-home)
(concat blog-home "/_posts/" filename ".markdown")))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment