Skip to main content

14.1.6 Publishing links

To create a link from one Org file to another, you would use something like ‘[[file:foo.org][The foo]]’ or simply ‘[[file:foo.org]]’ (see External Links). When published, this link becomes a link to ‘foo.html’. You can thus interlink the pages of your “Org web" project and the links will work as expected when you publish them to HTML. If you also publish the Org source file and want to link to it, use an ‘http’ link instead of a ‘file:’ link, because ‘file’ links are converted to link to the corresponding ‘.html’ file.

You may also link to related files, such as images. Provided you are careful with relative file names, and provided you have also configured Org to upload the related files, these links will work too. See Complex example, for an example of this usage.

Eventually, links between published documents can contain some search options (see Search Options), which will be resolved to the appropriate location in the linked file. For example, once published to HTML, the following links all point to a dedicated anchor in ‘foo.html’.

[[file:foo.org::*heading]]
[[file:foo.org::#custom-id]]
[[file:foo.org::target]]