Last active
August 29, 2015 14:07
-
-
Save tpanum/f1bcd76cfdc6d3f3b28a to your computer and use it in GitHub Desktop.
Revisions
-
tpanum revised this gist
Oct 14, 2014 . 1 changed file with 20 additions and 18 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,23 +1,25 @@ (defun tpanum/create-jekyll-post (title) "Creates a new buffer and file for a blog post" (interactive "sTitle of blog post: ") (let ((filename (concat (format-time-string "%Y-%m-%d-") (replace-regexp-in-string " " "-" (downcase (replace-regexp-in-string "[^0-9a-zA-Z ]" "" title)))))) (switch-to-buffer (generate-new-buffer filename)) (insert (concat (mapconcat 'identity '("---" "layout: post") "\n") "\n" "title: '" title "'\n" "date: '" (format-time-string "%Y-%m-%d %H:%M:%S %z") "'\n" "---\n")) (if (boundp 'blog-home) (write-file (concat blog-home "/_posts/" filename ".markdown"))))) -
tpanum renamed this gist
Oct 14, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
tpanum created this gist
Oct 14, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ (defun tpanum/create-jekyll-post (title) "Creates a new buffer and file for a blog post" (interactive "sTitle of blog post: ") (let ((filename (concat (format-time-string "%Y-%m-%d-") (replace-regexp-in-string " " "-" (downcase (replace-regexp-in-string "[^0-9a-zA-Z ]" "" title)))) )) (switch-to-buffer (generate-new-buffer filename)) (insert (concat (mapconcat 'identity '("---" "layout: post") "\n") "\n" "title: '" title "'\n" "date: '" (format-time-string "%Y-%m-%d %H:%M:%S %z") "'\n" "---\n" ) ) (if (boundp 'blog-home) (write-file (concat blog-home "/_posts/" filename ".markdown"))) ))