Skip to main content

I don't think I've ever actually written an interactive emacs function that takes an argument, but here we are:

(defun new-today-post (&optional date)
  "Make a new easy-hugo post, for today's date or with a prefix arg, another date."
  (interactive "P")
  (if date
      (easy-hugo-newpost (concat (org-read-date) ".md"))
    (easy-hugo-newpost (format-time-string "%Y-%m-%d.md")))
  )

(global-set-key (kbd "C-c b") 'new-today-post)