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

Improve documentation for menu rendering. #3056

Merged
merged 1 commit into from Feb 21, 2017

Conversation

LiaungYip
Copy link
Contributor

Fixes #1393

@LiaungYip
Copy link
Contributor Author

Hopefully the examples I added will help new users trying to build nested menu templates.

I tried to cover the things which confused me when I was learning it:

  • Using the HasMenuCurrent() and IsMenuCurrent() functions to style the active menu items;
  • Using recursive partial templates to render nested menus;
  • Only rendering the sub-menus relevant to the current page.

Note: I tried to sign the project CLA, but https://cla-assistant.io/spf13/hugo currently gives an error.

@LiaungYip
Copy link
Contributor Author

menutest.zip

A small Hugo site illustrating use of the menu functions, on nested menus.

@bep bep added the Docs label Feb 18, 2017
@bep
Copy link
Member

bep commented Feb 18, 2017

This is very, very good.

A little note about the recursive part. I just fixed a recursive bug reported by a user that used inline template definitions to recursive render a menu, see the link from the issue linked in here:

bdc02ed

@LiaungYip
Copy link
Contributor Author

Hi @bep , is this good to merge or did you want further edits?

@bep
Copy link
Member

bep commented Feb 21, 2017

No, it looks very good to me -- but I try to delegate doc merges to @digitalcraftsman

@bep bep added this to the v0.19 milestone Feb 21, 2017
@digitalcraftsman digitalcraftsman merged commit d3fb196 into gohugoio:master Feb 21, 2017
@LiaungYip LiaungYip deleted the menu-docs branch February 21, 2017 11:16
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix menu doc
3 participants