Hi - Hugo newbie here. I’m having issues while deploying the site using Netlify. The navigation links(including the homepage link on the top left) are broken: clicking on ‘tags’ after ‘about’ renders the URL as https://tender-wiles-5d6778.netlify.app/about/tags
instead of https://tender-wiles-5d6778.netlify.app/tags
I understand there might be an issue with the baseURL config in my config.toml
I’ve tried setting the baseURL= "\"
I’ve also tried changing the menu URLs like this: url = "\about"
which seems to fix the menu item but not the homepage link on the left.
Could someone please help? What am I missing here? Thanks in advance!
I added leading slashes to the menu items which now resolve correctly. However, my link to the homepage(the one with my name, on the top left) is still not resolving to root. Any advice on how can I fix this? (I tried checking the documentation for handling URLs but couldn’t find relevant info.)
Thank you, @andreseduardop and @fgandiya. I added the netlify generated URL to the baseURL, and added leading slashes to the menu items. The navigation works correctly now.
Here’s my general question about Hugo: since netlify generates URLs dynamically I don’t have a way to know what link we’ll use before I actually deploy the app. Does that mean that I’ll have to change the base URL ever time the netlify URL changes, or is there a way to dynamically accept a generated url at deploy time? (Not a big issue, just asking for my understanding of best practices.)
Once Netlify generates the address it will not change.
Tip
You can change a site’s default Netlify subdomain by selecting the Options button next to the subdomain in the Custom domains panel, then selecting Edit site name in the dropdown.