Having seen the other posts on this, I think I'll need to spend more time thinking about this and the various use cases. There is something I'm having trouble putting my finger on which doesn't feel quite right, but I feel I need to look more deeply into the whole idea of how to export links generally. Originally, I was thinking just about HTML export and just file:// vs site context specific links.
Based on what you have provided, this certainly does seem to address the specific use case I was thinking of, but others have pointed out additional considerations, so I'm now not sure if the suggested approach won't improve one case while making others more difficult/restricted. Tim Nicolas Goaziou writes: > Hello, > > Tim Cross <theophil...@gmail.com> writes: > >> Perhaps we need a way to easily set a context for web exports. If the >> context is set, then use it, otherwise, use file:/// (actually, I >> thought this was already there, but it has been a while since I did html >> exports where links were necessary). > > The following patch implements `org-html-root', which allows to export > file links as root-relative URL. I'm not sure the docstring is clear > enough, tho. > > Also, HTML publishing process always bind the above to publishing > directory, without user intervention. > > So, basically, upon exporting the following document to HTML: > > #+html_link_root: /tmp/ > [[/tmp/unicorn.jpg]] > > the link becomes > > <img src="/unicorn.jpg" alt="unicorn.jpg" /> > > > WDYT? > > Regards, -- Tim Cross