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

Projects
None yet
3 participants
@LiaungYip
Contributor

LiaungYip commented Feb 18, 2017

Fixes #1393

@LiaungYip

This comment has been minimized.

Show comment
Hide comment
@LiaungYip

LiaungYip Feb 18, 2017

Contributor

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.

Contributor

LiaungYip commented Feb 18, 2017

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

This comment has been minimized.

Show comment
Hide comment
@LiaungYip

LiaungYip Feb 18, 2017

Contributor

menutest.zip

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

Contributor

LiaungYip commented Feb 18, 2017

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

This comment has been minimized.

Show comment
Hide comment
@bep

bep Feb 18, 2017

Member

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

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

This comment has been minimized.

Show comment
Hide comment
@LiaungYip

LiaungYip Feb 21, 2017

Contributor

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

Contributor

LiaungYip commented Feb 21, 2017

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

@bep

This comment has been minimized.

Show comment
Hide comment
@bep

bep Feb 21, 2017

Member

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

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

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@LiaungYip LiaungYip deleted the LiaungYip:menu-docs branch Feb 21, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment