> You just need a custom :sitemap-function. > The default `org-publish-sitemap-default' flattens the hierarchy. > > From the manual: > > ‘: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. > > You may create a function similar to `org-publish-sitemap-default' but > using `org-list-to-subtree' instead of `org-list-to-org' Thanks for the pointers, but I can't figure out how to get from there to a toc? As I understand, `list' is a list of files from my project and `org-list-to-subtree' does add stars to this list. But how do I get all sections and subsections from my file to appear here?