Permalink confusion

Hi! I’ve managed to get myself quite confused with permalinks.

This is my site structure:
content
- odds_and_sods

This is in my config.toml:
[permalinks]
odds_and_sods = “/:year/:month/:section/:title/”

Then in my index.html I am doing the following:

{{ range .Site.RegularPages }}`    
<a href="{{ .Permalink }}" target="_blank" alt="link to post">
	    <div class="{{ .Section }} entryPreview">
	   	<h3>{{ .Params.title }}</h3>
	    <p class="summary">{{ .Params.summary }}</p>
	    </div>
	</a>
	{{ end }}`

Everything is working except the link, which is 404ing.

I’ve not done much with Hugo so am probably missing something simple. I’ve tried with an empty baseURL and with example.com, I’ve tried building the site and the link doesn’t work there either.

What is the link producing and what are you expecting? Which version of Hugo are you using?

Hugo version 0.20.7 (Windows). Expecting a link to an individual page with just that post on it. Getting a 404.

And also resolved it - literally woke in the middle of the night and gave myself a smack round the head. Noob mistake: I hadn’t provided a template for single pages.

1 Like