From 0fe3065f7ca9aa4c02c48e186fccb91ad3a81f59 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Wed, 3 Sep 2025 13:58:22 -0500 Subject: refactor: Simplify org-capture templates; fix duplicate properties The commit simplifies and streamlines the Org configuration by: - Removing grocery and shopping list templates - Cleaning up org-roam templates by moving content to template files - Removing webclip specific template and function - Improving formatting and indentation for better readability This also fixes an issue where duplicate org-roam properties were being inserted into the resulting capture file. --- modules/org-capture-config.el | 6 ---- modules/org-roam-config.el | 74 ++++++++++++++++++------------------------- 2 files changed, 30 insertions(+), 50 deletions(-) (limited to 'modules') diff --git a/modules/org-capture-config.el b/modules/org-capture-config.el index e9a83d9d..f56f322a 100644 --- a/modules/org-capture-config.el +++ b/modules/org-capture-config.el @@ -101,12 +101,6 @@ Captured On: %U\n" :prepend t) Captured On: %U" :prepend t) - ("g" "Grocery List Item" item - (file+headline inbox-file "Grocery List") "%?") - - ("s" "Shopping List Entry" entry - (file+headline inbox-file "Shopping List") "* %?") - ;; requires cj/org-web-clipper function defined above ("w" "Web Page Clipper" entry (file+headline inbox-file "To Read") diff --git a/modules/org-roam-config.el b/modules/org-roam-config.el index 1f1524aa..684b83c8 100644 --- a/modules/org-roam-config.el +++ b/modules/org-roam-config.el @@ -17,41 +17,36 @@ (org-roam-completion-everywhere t) (org-roam-dailies-capture-templates '(("d" "default" entry "* %<%I:%M:%S %p %Z> %?" - :if-new (file+head "%<%Y-%m-%d>.org" "#+FILETAGS: Journal -#+TITLE: %<%Y-%m-%d>")))) + :if-new (file+head "%<%Y-%m-%d>.org" + "#+FILETAGS: Journal #+TITLE: %<%Y-%m-%d>")))) + (org-roam-capture-templates '(("d" "default" plain "%?" - :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+TITLE: ${title}\n") - :unnarrowed t) - ("w" "webclip" plain "%?" - :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+TITLE: ${title} -#+FILETAGS: webclipped -#+ROAM_KEY: ${url} -URL: ${url} -Captured On: %U - -${body}") - :unnarrowed t - :immediate-finish t) - ("v" "v2mom" plain - (function (lambda () (concat roam-dir "templates/v2mom.org"))) - :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+TITLE: ${title}\n") - :unnarrowed t) - ("r" "recipe" plain - (function (lambda () (concat roam-dir "templates/recipe.org"))) - :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+TITLE: ${title} - #+CATEGORY: ${title}\n#+FILETAGS: Recipe\n#+STARTUP: showall") - :unnarrowed t) - ("p" "project" plain - (function (lambda () (concat roam-dir "templates/project.org"))) - :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+TITLE: ${title} - #+CATEGORY: ${title}\n#+FILETAGS: Project") - :unnarrowed t) - ("t" "topic" plain - (function (lambda () (concat roam-dir "templates/topic.org"))) - :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+TITLE: ${title} - #+CATEGORY: ${title}\n#+FILETAGS: Topic") - :unnarrowed t))) + :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" + "#+TITLE: ${title}\n") + :unnarrowed t) + + ("v" "v2mom" plain + (function (lambda () (concat roam-dir "templates/v2mom.org"))) + :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "") + :unnarrowed t) + + ("r" "recipe" plain + (function (lambda () (concat roam-dir "templates/recipe.org"))) + :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "") + :unnarrowed t) + + ("p" "project" plain + (function (lambda () (concat roam-dir "templates/project.org"))) + :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "") + :unnarrowed t) + + ("t" "topic" plain + (function (lambda () (concat roam-dir "templates/topic.org"))) + :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "") + :unnarrowed t))) + + :bind (("C-c n ?" . org-roam-hydra/body) ("C-c n l" . org-roam-buffer-toggle) ("C-c n f" . org-roam-node-find) @@ -130,9 +125,8 @@ created nodes are added to the agenda and follow a template defined by nil :templates `((,template-key ,tag plain (file ,template-file) - :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" - ,(concat "#+TITLE: ${title} -#+CATEGORY: ${title}\n#+FILETAGS: " tag)) + :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" + "") :unnarrowed t)))) (defun cj/org-roam-find-node-topic () @@ -151,14 +145,6 @@ created nodes are added to the agenda and follow a template defined by (interactive) (cj/org-roam-find-node "Project" "p" (concat roam-dir "templates/project.org"))) -(defun cj/org-roam-find-node-webclip () - "List nodes of type 'webclipped' in completing read for selection." - (interactive) - (org-roam-node-find - nil - nil - (cj/org-roam-filter-by-tag "webclipped") - nil)) ;; ---------------------- Org Capture After Finalize Hook ---------------------- -- cgit v1.2.3