What do y'all do about static non-org assets?


Curious what others are doing for non-Org Mode assets linked from Org Roam nodes? Ex: For work I do many infrastructure diagrams. Some of them are generated from code in an org-babel code block but others are generated with non-Emacs tools. All of them end up generating static assets which I then link from the Org Roam nodes. Ex: jpg, png, svg.

Currently I have an <Org Roam dir>/assets directory where I dump things and then link to them from the nodes by path. It would perhaps be more Roam-y to have those assets have at least have an Org ID. For export purposes, it may also make sense to have them be in a directory alongside the node file.

I just do essentially the same thing as you do: I put images to images/ subdirectory. I can’t think of a good reason to add an org-ID to static images.

I name them with the same date (in file name like yyyy-mm-ddThhmmss.png); this way it’s easier for me to find them.

The main reason I think it might make sense to be able to associate an Org ID with non-Org content is that I often write docs which generate diagrams and viz from Org Babel code blocks which are then referenced in other Org nodes (ex: infrastructure diagrams). If the viz had an ID I could then link to it independent of path and filename (ex: infratructure diagrams). In other environments, such as hugo, I’ve worked with teams that had shortcodes for thing kind of thing.

I’m not much of an elisp hacker but I’m going to play around with setting Org ID Properties on output of Babel code blocks and see where that might get me.

Have a look at org-attach (see Attachments (The Org Manual)) it essentially automates the adding of a non-org asset to a directory which is associated with the nodes/headlines Org ID. You can then use the attachment: link type to link to these assets.

I use this method and am pretty happy with it.

1 Like

This looks quite promising. And it was right there in core org the entire time. :forehead

Thanks for pointing it out!