With the following snippet, I can call M-x hakyll-blog-new-post
,
fill in the title and get started writing right away.
nil
(defgroup hakyll-blog "Hakyll Blog."
'applications)
:group
(defcustom hakyll-blog-dir"~/blog"
"Hakyll blog directory."
:type 'string
'hakyll-blog)
:group
(defcustom hakyll-blog-file-time-format"%Y-%m-%d"
"Hakyll blog post filename time format."
:type 'string
'hakyll-blog)
:group
defun hakyll-blog-new-post (title)
("Create new blog post under `hakyll-blog-dir' with given TITLE."
"sBlog post title: ")
(interactive
(find-file (hakyll-blog--file-format title))format "---\ntitle: %s\ntags: \n---\n\n" title)))
(insert (
defun hakyll-blog--file-format (title)
("File name for TITLE post."
format "%s/posts/%s-%s.markdown"
(
(expand-file-name hakyll-blog-dir)
(format-time-string hakyll-blog-file-time-format) (s-dashed-words title)))