commit - 0c253dabc0bdbef78bba6b5c04d1800f087464e7
commit + 433f0624f2cfa81e1473bb4665125cc7e16c8931
blob - 5122004a59f4c069e4856316448955e598df0e98
blob + 97b2fde8597a4626b0543d99dc9fb767e4ef699c
--- doom/custom.el
+++ doom/custom.el
"* %?"))
(add-to-list 'org-capture-templates
- '("j" "Journal (Markdown)" plain
+ '("j" "Journal" plain
(file (lambda ()
- (let* ((date-str (format-time-string "%Y-%m-%d-%H-%M"))
- (custom-str (read-string "Journal Title: "))
- (filename (concat date-str "-" custom-str ".md")))
- (expand-file-name filename "~/Journal/"))))
- "# %^{Title}\n\n%U\n\n%?"
+ (let* ((date-str (format-time-string "%Y-%m-%d-%H%M"))
+ (title (read-string "Journal Title: "))
+ (slug (string-trim
+ (replace-regexp-in-string
+ "[^a-z0-9]+" "-" (downcase title))
+ "-" "-"))
+ (filename (concat date-str "-" slug ".org")))
+ (setq +journal--title title)
+ (expand-file-name filename "~/org/me/journal/"))))
+ "#+title: %(progn +journal--title)\n#+date: %U\n\n%?"
:empty-lines 1)))
(map! :leader
:desc "Capture to inbox"
"m i" (lambda () (interactive) (org-capture nil "i")))
-;; Keybinding for Journal (Markdown)
+;; Keybinding for Journal
(map! :leader
- :desc "Journal (Markdown)"
+ :desc "Journal"
"m j" (lambda! () (interactive) (org-capture nil "j")))
;; Set custom org-todo items