0

I would like to get my org roam dailies capture template to work but it returns with an error saying that the heading is not unique on level 1. My dailies capture template is as below:

(org-roam-dailies-capture-templates
   (let ((head
          (concat
           "#+title: %<%A, %d %B %Y>\n#+roam_tags: Dailies\n* Inbox\n* Log\n"
           "* [/] Do Today\n- [ ] Morning pages\n- [ ] Go through inbox\n- [ ] Flashcards\n* [/] Possibly Do Today\n")))
     `(("d" "default" entry
        "* %?"
        :if-new (file+head+olp "%<%Y>/%<%B>/%<%Y-%m-%d>" ,head ("Inbox"))
        :unnarrowed t)
       ("D" "default + reference" entry
        "* %?
%a"
        :if-new (file+head+olp "%<%Y>/%<%B>/%<%Y-%m-%d>" ,head ("Inbox"))
        :unnarrowed t)
       ("j" "journal" entry
        "* %U: %?"
        :if-new (file+head+olp "%<%Y>/%<%B>/%<%Y-%m-%d>" ,head ("Log")))
       ("J" "journal + refernce" entry
        "* %U: %?
%a"
        :if-new (file+head+olp "%<%Y>/%<%B>/%<%Y-%m-%d>" ,head ("Log")))
       ("t" "Do Today" item
        "[ ] %a"
        :if-new (file+head+olp "%<%Y>/%<%B>/%<%Y-%m-%d>" ,head ("Do Today"))
        :immediate-finish t)
       ("p" "Possibly Do Today" item
        "[ ] %a"
        :if-new (file+head+olp "%<%Y>/%<%B>/%<%Y-%m-%d>" ,head ("Possibly Do Today"))
        :immediate-finish t)
       )))

I'm using org-roam v2 in Doom Emacs on Ubuntu 20.04

0

Your template is just fine. I copied it into my configuration and it worked. The problem is, you have one of your headings more than once in your daily journal. The easiest solution would probably be to remove the multiple(s). Seems like this is not specific to org-roam-templates. From org-capture:

‘(file+headline "filename" "node headline")’

Fast configuration if the target heading is unique in the file.

‘(file+olp "filename" "Level 1 heading" "Level 2" ...)’

For non-unique headings, the full path is safer.

Since your duplicate is on level 1 I don't see how you could differentiate them by path, thus deleting or renaming the heading in your journal should solve the issue. Let me know if this solves your problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.