Skip to content

Allow arbitrary nesting in sidebar.yml #1947

Closed
@felixmulder

Description

@felixmulder

Currently the sidebar allows only one additional level of nesting. This should be changed to allow arbitrary nesting in sidebar.yml for more freedom in page layout.

Currently valid:

sidebar:
    - title: Blog
      url: blog/index.html
    - title: Usage
      subsection:
        - title: Dottydoc
          url: usage/dottydoc.html

Currently invalid, but should be allowed:

sidebar:
    - title: Blog
      url: blog/index.html
    - title: Usage
      subsection:
        - title: Dottydoc
          subsection:
            - title: Dottydoc page 1
              url: usage/dottydoc1.html
            - title: Dottydoc page 2
              url: usage/dottydoc2.html

To achieve the current functionality, we have a split between using toc.html which is included from sidebar.html for rendering, and a custom tag named renderTitle which is implemented in tags.scala.

The current implementation looks at the current path of the page to decide which element to give a CSS show class. When given a show class, the subsection for that element will be visible.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions