14.1.7 Generating a sitemap

The following properties may be used to control publishing of a map of files for a given project.

:auto-sitemap

When non-nil, publish a sitemap during org-publish-current-project or org-publish-all.

:sitemap-filename

Filename for output of sitemap. Defaults to ‘sitemap.org’, which becomes ‘sitemap.html’.

:sitemap-title

Title of sitemap page. Defaults to name of file.

:sitemap-style

Can be list (site-map is just an itemized list of the titles of the files involved) or tree (the directory structure of the source files is reflected in the site-map). Defaults to tree.

:sitemap-format-entry

With this option one can tell how a site-map entry is formatted in the site-map. It is a function called with three arguments: the file or directory name relative to base directory of the project, the site-map style and the current project. It is expected to return a string. Default value turns file names into links and use document titles as descriptions. For specific formatting needs, one can use org-publish-find-date, org-publish-find-title and org-publish-find-property, to retrieve additional information about published documents.

:sitemap-function

Plug-in function to use for generation of the sitemap. It is called with two arguments: the title of the site-map and a representation of the files and directories involved in the project as a nested list, which can further be transformed using org-list-to-generic, org-list-to-subtree and alike. Default value generates a plain list of links to all files in the project.

:sitemap-sort-folders

Where folders should appear in the sitemap. Set this to first (default) or last to display folders first or last, respectively. When set to ignore, folders are ignored altogether. Any other value mixes files and folders. This variable has no effect when site-map style is tree.

:sitemap-sort-files

How the files are sorted in the site map. Set this to alphabetically (default), chronologically or anti-chronologically. chronologically sorts the files with older date first while anti-chronologically sorts the files with newer date first. alphabetically sorts the files alphabetically. The date of a file is retrieved with org-publish-find-date.

:sitemap-ignore-case

Should sorting be case-sensitive? Default nil.