The HTML export backend transforms Org’s internal links (see Internal Links) to equivalent HTML links in the output. The backend similarly handles Org’s automatic links created by radio targets (see Radio Targets) similarly. For Org links to external files, the backend transforms the links to relative paths.
For Org links to other ‘.org’ files, the backend automatically
changes the file extension to ‘.html’ and makes file paths relative.
If the ‘.org’ files have an equivalent ‘.html’ version at the same
location, then the converted links should work without any further
manual intervention. However, to disable this automatic path
translation, set org-html-link-org-files-as-html
to nil
. When
disabled, the HTML export backend substitutes the ID-based links in
the HTML output. For more about linking files when publishing to
a directory, see Publishing links.
Org files can also have special directives to the HTML export
backend. For example, by using ‘#+ATTR_HTML’ lines to specify new
format attributes to <a>
or <img>
tags. This example shows
changing the link’s title and style:
#+ATTR_HTML: :title The Org mode website :style color:red; [[https://orgmode.org]]