问题
My question is quite simple though I cannot find anything that points to it in the documentation.
I am generating documentation for a project with the default generator in Antora but I cannot figure out how to customize the top navigation bar, items on the right side, which have some defaults.
Since the site is generated, where should I change, or how, those items? I do not want to list such items there.
回答1:
There is an additional approach that does not require you to create a standalone UI: supplemental_files
In your playbook file, you can specify:
...
ui:
supplemental_files: <path to supplemental UI folder>
...
The supplemental UI folder provides replacement files for the UI, provided that they appear in the same structure as the UI that is in use.
So, to replace header-content.hbs
for the default UI, you would create this folder structure:
supplemental-ui/
partials/
header-content.hbs
You can see how this facility is used by exploring the repo for the Antora docs: https://gitlab.com/antora/docs.antora.org
You can replace any file used by the UI in this fashion, and add new files. You cannot remove files, but you can make their content empty. Altogether, this means that you can change any CSS, Javascript, partials, layouts, and provide any additional global UI assets as required.
回答2:
Yep, you need to build your own UI. The docs for that are available here: https://docs.antora.org/antora-ui-default/
Like Matt said, you'll need to check your header-content.hbs
handlebars.
来源:https://stackoverflow.com/questions/53691002/antora-top-navigation-bar-customization