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

How to configure the menu from config.toml #52

Closed
kamar535 opened this issue Jul 5, 2017 · 6 comments
Closed

How to configure the menu from config.toml #52

kamar535 opened this issue Jul 5, 2017 · 6 comments
Labels

Comments

@kamar535
Copy link
Contributor

kamar535 commented Jul 5, 2017

Using this theme I can successfully add a weight in the page front-matter.

Usually the menu for a Hugo site can also be configured from the config.tom file by adding entries to [[menu.main]], see https://gohugo.io/extras/menus/

But, for this theme this does not work, is there another way to configure the menu from config.toml?

Hugo version: 0.21

@matcornic
Copy link
Owner

matcornic commented Jul 22, 2017

Hello @kamar535 , this theme does not use Hugo menus at all. The menu is automatically generated from sections.

In the FrontMatter of your pages, the Title parameter will be used as label of the menu. The weight will be used to order sections in the menu.

More explanations: https://matcornic.github.io/hugo-learn-doc/cont/pages/#types

@kamar535
Copy link
Contributor Author

Tanks for the answer.

Maybe the theme documentation could mention https://gohugo.io/content-management/sections/ and that the menu can only be configured from the pages front matter.

@matcornic
Copy link
Owner

Actually, the theme is currently on a rewrite to use latest features of Hugo: nested sections. In the future release, menu will be also generated automatically but infinite level of sections will be possible!

Therefore, the documentation will be updated as well.

Follow #51 for more information.

@matcornic matcornic reopened this Aug 8, 2017
@amberalpha
Copy link

This is an old thread but hope it's ok to chip in? I like Learn a lot and just want to simplify the (side) menu, eliminating the parts not generated from my content i.e. everything under 'More' and the search box. Must be an easy way... I get a bit lost in the docs.

@acuvic
Copy link

acuvic commented May 31, 2020

This is an old thread but hope it's ok to chip in? I like Learn a lot and just want to simplify the (side) menu, eliminating the parts not generated from my content i.e. everything under 'More' and the search box. Must be an easy way... I get a bit lost in the docs.

Hi Amberalpha, you've probably found the solution. Just delete any [[menu.shortcuts]] in config.toml
My own question to @matcornic : firstly a great theme, and I've used 4 different ones on live sites, I'll contribute. Question is can I change the "MORE" wording in menu to "Latest Addition" ? Been searching for ages but cannot find. Thanks

@acuvic
Copy link

acuvic commented Jun 1, 2020

Ignore last question - found "More" is set in the i18n folder under en.toml

patrick-othmer pushed a commit to patrick-othmer/hugo-theme-learn that referenced this issue Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants