I’m new to Hugo and ran into a hiccup regarding creating my site’s navigation.
Problem: My site’s urls all require /index.html at the end of the URL string. From what I’ve read in the docs, PrettyUrls should be enabled by default thereby preventing this kind of behavior (unless I’ve misread?).
Unfortunately, my repo is private. But my nav structure looks like this:
Navigating to my site’s pages results in a URL that looks like this: www. mysite. com/index. html
I want the URL to read: www. mysite. com/
I’ve made no modifications to the site’s config and have attempted setting hugo -e HUGO_PRETTYURLS=true in my terminal to see if I can build something without the /index.html ending. I get the same results every time.
Unfortunately none of these recommendations worked.
I don’t have uglyurl set in my config. And after updating my nav template to match yours (and the menu docs for Hugo), I’m still seeing the index.html in my URL.
It’s cool. By setting the uglyurl to true, I’m a little closer to what I want.
For more context, my directory is set up as follows:
.
└── content
└── events
└── index.md
Based on the examples in the docs, I expected the url to be something like https:// example .com/events/, but instead I’m getting https:// example .com/events/index.html
By setting uglyURLs = true, I now get https:// example .com/events.html - which is closer to what I wanted.
Thanks for your help on this, but I think I’m good.