Yet another: What is going on with my relationship of /content to /templating

I currently have the structure:


http://localhost:1313/ works exactly as expected (/content/ data is put into /layouts/_default/single.html although if I rename this file to /layouts/index.html it doesn’t work as expected).

However http://localhost:1313/blog/test-blog/ does not.

I am not sure if this is a bug but if I run hugo server and then add or delete /content/blog/ I don’t get a 404 at http://localhost:1313/blog/test-blog/ or http://localhost:1313/blog/.
BUT if I restart and don’t edit or delete the I get a 404…

Anyway even at http://localhost:1313/blog/test-blog/ (when it kinda works) It uses the /layouts/_default/single.html template not the /layouts/_default/blog/single.html template - it also doesn’t have any content but that is as expected as there isn’t the corresponding data that is in /content/

What is going on? Thanks in advance :slight_smile:


baseURL = ""
languageCode = "en-gb"
title = "My New Hugo Site"
  changefreq = "monthly"
  filename = "sitemap.xml"
  priority = 0.5

title = "Test Blog"



it works!!! {{ .Params.title }}


it has unfortunately used this template!!! {{ .Params.title }}

/layouts/_default/blog/single.html and /layouts/_default/blog/list.html

should be under /layouts/blog/

How do you mean under sorry?

I have moved /layouts/_default/blog/single.html to /layouts/blog/single.html and now it finds the write template but I am still having the 404 issue where I have to change the /content/blog/ file

Here is an example of what I mean. I turn the server on - 404, undelete the no more 404, turn the server on and off - 404, delete the no more 404. What is going on?

can you give us a (sample) repository for help?

Check how the permalinks for the blog section are defined (in your config file).
Let hugo render all to the public directory and check out the files.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.