negrel / hugo-theme-pico

:black_circle: Pico is a minimalist, readable, responsive, light and beautiful Hugo theme.

Home Page:https://sponge-bob.netlify.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Editing menu.main in config.toml

Lmementomori opened this issue · comments

Hello, I am new to Hugo and I am using Pico theme to create my website (using Windows 10 and VS code).

I have carefully followed the Get the Theme indications, copied exampleSite to my website folder, added Pico as my themes submodule and the rest.

I would like to now edit and add more pages to the navigation bar, as well as create another language. However, as I try to edit and add pages to menu.main in config.toml, following the existing pattern, for example:

[[menu.main]]
identifier = "biography" # identifier is use for translations
pre = "" # pre is inserted before the translation (icons, image, etc)
url = "/biography/" 
weight = 30

nothing changes on my preview website in local1313. I have also created pages in the content/en folder by using hugo new biography.md and hugo new biography/_index.md commands, however if I try to edit the Front Matter of these files nothing shows up on my local1313 either.

If I edit the existing information in the config.toml of my website, such as title, social params or disable a language, the content in the local1313 changes accordingly.

I would like to find out why I cannot add pages to menu.main and content using config.toml. Is it possible I missed something?
Currently my data and layouts folders in my website are empty, while everything else is running well, could this be an issue? My node_modules folder is also in grey.

Hello, did you add an identifier named "biography" in i18n/en files ? Did you check using your browser dev tools that the menu entry you added is absent ?
If you didn't, the menu entry may be present but with no text since the identifier doesn't map to any text/string.

Otherwise, what you tried to achieve is totally doable.

Hello,

Thank you very much for a quick reply and your tips. I have added an identifier named 'biography' in i18n/en files and it did work. However, as I tried to add other 4 pages, those additional pages still did not appear on navigation bar. In fact, the i18n/en file became highlighted in orange/red on my VS code and the added identifiers such as 'biography' are highlighted by a blue line on left.

The menu entry I have added is absent in dev tools.

Is it possible I need to edit layouts ? My repository is now uploaded on my profile and available for a review.

You shouldn't edit anything under themes/pico, everything you add must be at the my_website/ level. For example, the biography identifier should be added in my_website/i18n/en.toml. Layouts contains the template code used to render markdown files under content/. I recommend you to read hugo docs in order to understand Hugo's concepts and terminology.
You repository is not visible on your profile (maybe in private ?) and I won't review it because I don't have time for it.

It seems that the theme works as expected and don't have any issue so I'm closing the issue.

Have a nice day :)