I currently have the structure:
/content/index.md
/content/blog/_index.md
/content/blog/test-blog.md
/layouts/_default/list.html
/layouts/_default/single.html
/layouts/_default/blog/single.html
/layouts/_default/blog/list.html
http://localhost:1313/ works exactly as expected (/content/index.md
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/_index.md
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 _index.md
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/index.md
.
What is going on? Thanks in advance
config.toml:
baseURL = "http://example.org/"
languageCode = "en-gb"
title = "My New Hugo Site"
[sitemap]
changefreq = "monthly"
filename = "sitemap.xml"
priority = 0.5
test-blog.md
:
+++
title = "Test Blog"
+++
/layouts/_default/blog/single.html
:
it works!!! {{ .Params.title }}
/layouts/_default/single.html
:
it has unfortunately used this template!!! {{ .Params.title }}