Working examples of note capture-templates?

I’m new to org-roam and would like to have a richer starting template than the default. Is there a guide beyond the manual? To start, I just want something like this when I create a new note:

#+title:
#+time:
#+location:

The default title creation is okay, but I’d like to be able to auto fill-in

(format-time-string “%Y-%m-%dT%H:%M:%S”)

i.e., the UTC date and time for #+time. I guessed/mucked around with Easy Customization and


Header format :
#+title: ${title}
#+time: %<%Y-%m-%dT%H:%M:%S>

finally worked for #+time, but I’d like to just run some elisp code such as

(defun insert-dateutc.1 ()
(interactive)
(insert (format-time-string “%Y-%m-%dT%H:%M:%S”)))

For #+location I’d also like to be able to do some elisp to get longitude and latitude, but that can wait till I hack geolocation.el for Linux.

Is there any good examples with code for customizing the note templates? I’d eventually like to add in my entire org-mode header section as well.

What you would like is beyond me, and I don’t have any example code.
With your elisp knowledge you exhibit, I don’t see why you need any more examples.

Sorry if you are already familiar with this, but I thought you could try what’s in this section of the official manual (copied below).

Alternatively, you could create your own capture function.

Perhaps you could enlighten the community if there are reasons why these approaches don’t work for you.

All of the flexibility afforded by Emacs and Org-mode are available. For example, if you want to encode a UTC timestamp in the filename, you can take advantage of org-mode’s %(EXP) template expansion to call format-time-string directly to provide its third argument to specify UTC.

("d" "default" plain (function org-roam--capture-get-point)
 "%?"
 :file-name "%(format-time-string \"%Y-%m-%d--%H-%M-%SZ--${slug}\" (current-time) t)"
 :head "#+title: ${title}\n"
 :unnarrowed t)