Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Submenu page #55

Open
antaldaniel opened this issue Dec 30, 2018 · 3 comments
Open

Submenu page #55

antaldaniel opened this issue Dec 30, 2018 · 3 comments

Comments

@antaldaniel
Copy link

I had spent hours trying to find a working example of a Hugo theme that handles submenus, and a working example how to arrange the content so that I see a working submenu. As far as I understand your theme handles submenues.

Would it be possible to include an inserted submenu with a static page under the Individual Page 1 item?

@parsiya
Copy link
Owner

parsiya commented Jan 2, 2019

I have never done a sub menu and frankly I don't remember how I implemented menus. I think I might have used the built-in template. But let me see what I can do tonight and if it actually supports sub-menus.

@antaldaniel
Copy link
Author

I was asking because as far as I read your template it has submenus, but there were no examples. I'll may give it a try, too.

@parsiya
Copy link
Owner

parsiya commented Jan 4, 2019

The theme does not have submenus. Neither in the navigation bar nor in the sidebar. I do not know enough about CSS to make it happen. But a template (for sidebar that can be modified for navigation bar) is here: https://gohugo.io/templates/menu-templates/.

But to add submenus, you have to do something like this. The top menu gets an identifier field. This helps because you can later change the name of the menu w/o having to modify anything else.

[[menu.sidebar]]
  Name = "External link to example.com"
  URL = "https://example.com"
  weight = 10
  identifier = "example"

Submenus are added normally with a parent field which points to the identifier of the parent.

[[menu.sidebar]]
  Name = "submenu1"
  URL = "https://example.com"
  weight = 10
  parent = "example"

[[menu.sidebar]]
  Name = "submenu2"
  URL = "https://example.com"
  weight = 20
  parent = "example"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants