appernetic / hugo-bootstrap-premium

Hugo appernetic bootstrap premium theme
MIT License
83 stars 62 forks source link

Add support for nested menus #30

Closed kd7uiy closed 6 years ago

kd7uiy commented 6 years ago

The following code will allow for nested menus.

appernetic commented 6 years ago

Do you have instructions on how to use it?

kd7uiy commented 6 years ago

The instructions are the standard Hugo ones, having menus with a "Parent" defined. https://gohugo.io/content-management/menus/#nesting

    [[menu.main]]
    name = "Section folder"
    identifier = "sect"
    url = “/section/”

    [[menu.main]]
    name = "Sublevel one"
    identifier = "sub1"
    url = “/section/folder1/”

    [[menu.main]]
    name = "Sublevel two"
    identifier = "sub2"
    url = “/section/folder2/”
gofford commented 6 years ago

Hey @kd7uiy (cc: @appernetic) how would this PR be extended to support arbitrary depth nesting?

This is a great addition but as-is the nesting only seems to allow a single-depth nest, i.e., if I wanted to add another menu at /section/folder1/mycontent it will not render, even if I set the parent correctly.

kd7uiy commented 6 years ago

Will consider it, but I borrowed the code from somewhere else, just figured out how to connect it. I'll add it to my todo list, but that list is rather lengthy at the moment, so...