Emacs' Org Roam Capture Templates Stored in Files

A little background

Since I post my Emacs dotfiles publicly, I can’t include sensitive data in it. I don’t want everyone on the wired to know how I structure my day and my morning routine =).

Elisp Here!

It appears that code snippets floating on the internet from 10 years ago no longer work! (yet still referenced by your LLM or search engine!). Here is how I got things to work in 2025:

Looking at the documentation of org-roam-capture-templates:

  %[pathname] Insert the contents of the file given by
              pathname.  These placeholders are expanded at the very
              beginning of the process so they can be used to extend the
              current template.

I do:

(org-roam-dailies-capture-templates
    `(("d" "default" entry "* %?" :target
    (file+head "%<%Y-%m-%d>.org" "%[~/Documents/Emacs/templates/dailies.orgcaptmpl"))))

But since I like to keep things neatly organized in variables, I do as follows:

(org-roam-dailies-capture-templates
    `(("d" "default" entry "* %?" :target
    (file+head "%<%Y-%m-%d>.org" ,(concat "%[" org-my-daily-template-file "]")))))

Note that I use it for org-roam-dailies-capture-templates but I believe it can be used for org-roam-capture-templates as well.

Other thoughts

I am supposed to start my day, but the fun of elisp is a little distracting haha! At least now I don’t have to copy paste my daily template every day. Surely this decrease in friction will increase my productivity and solve my procrastination problems…

A: I Spent the whole day modding emacs!. B: Are you Gonna work now? A:Work? Wtf… I can’t work, I need to keep modding so it’s fun once i work