Antora top navigation bar customization
Asked Answered
D

2

11

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.

Directorial answered 9/12, 2018 at 9:35 Comment(1)
Looks to me that the top level navigation is controlled by the antora-ui-default in header-content.hbs - so presumably you need to create your own antora-ui projectPeridium
S
11

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.

Sulphuric answered 14/6, 2019 at 16:10 Comment(0)
N
1

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.

Nevertheless answered 18/3, 2019 at 9:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.