Analytics or adding custom metadata to documentation webpage

@ethankusters or @marcus_ortiz can you share details (some documentation) on the experimental feature of custom headers/footers? I am unable to find how this works :(

If you include the --experimental-enable-custom-templates flag when invoking docc convert, it will utilize the contents of a top-level header.html and/or footer.html file in your documentation catalog and inject it into the appropriate parts of the rendered documentation pages.

This is lacking documentation at the moment due to its experimental nature. There are some potential issues with using a custom footer, as it will replace the default footer which has the color scheme controls. I think it might make sense to update the docs to highlight this though.

Also, is there any update on adding custom metadata to documentation webpage through other means?

There aren't any supported means for doing this at the moment that I'm aware of. Circling back to the original post, I don't think the custom header/footer would be a good way of adding this kind of metadata, since the header/footer would not be part of the <head> element.

To workaround this, I think you would likely need to directly modify the HTML that DocC produces to add this kind of metadata manually until there is a better supported way in the future.

1 Like