;; maintain daemon.de hugo website ;; (require 'subr-x) (setq daemon-de-site "~/dev/daemon.de") (setq daemon-de-template "--- title: \"%s\" draft: false date: %s tags: - %s --- ") (defun daemon-de-title2slug(title) (interactive) (concat (format-time-string "%Y-%m-%d-") (replace-regexp-in-string "[[:nonascii:]]" "" (replace-regexp-in-string " " "-" (downcase title))) ".md")) (defun daemon-de-new-blogpost(title tag) "Create a new blog posting for daemon.de" (interactive "sEnter blog post title: \nsEnter a tag: ") (find-file (format "%s/content/posts/%s" daemon-de-site (daemon-de-title2slug title))) (setq timestamp (format-time-string "%Y-%m-%dT%H:%M:%S+0100")) (insert (format daemon-de-template title timestamp tag))) (provide 'init-daemonde) ;;; init-daemonde.el ends here