Hi, Earl, Thanks for proposing a solution! I think maybe there's a better way, though.
Earl Chase <[email protected]> writes: > Subject: [PATCH] ol.el: New link type for relative urls I think 'relative urls' is a bit of a misnomer here, since regular Org links handle /folder-relative/ urls just fine. What can trip the user up when publishing, and the real problem that this patch addresses, is /root-relative/ paths starting with a slash, which get exported to HTML as "file://" URLs instead of relative to the server root. If we do end up using a new link type as the solution, I think this should be reflected in the documentation (and perhaps in the name of the link type). > Links that start with 'rel-url' followed by a colon will be treated > as relative urls. When these links are exported to markdown or HTML > documents, they are properly converted into relative URL links. I have > added an open function that will request a base URL when called so that users > will still have the option to open these URLs as they would with absolute > URLs. I'm not sure a new link type is the best approach. If you wanted to add this link the simple way, with 'C-u C-c C-l', you'd need to edit out the 'file:~/path/to/folder' bit afterwards. And then, in order to follow the link between Org files, the user needs to supply the base URL they had to edit out in the previous step. I think a better solution to this problem is to export ordinary file links in such a way that the local file path to the base directory (containing the Org source files for the web pages) is replaced with "/". This could be done automatically for any links matching the :base-directory of a current publishing process, as well as any other directories listed in a new user variable. I just sent a reply expanding on this to Khalid's original FR: https://list.orgmode.org/[email protected] What do you think? Regards, Christian
