Antora top navigation bar customization

喜你入骨 提交于 2021-02-07 19:11:55

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!