Hello,
I have a website that I had not maintained for a while. It was made with hugo 0.20, back in 2017, but now I would like to port it to the current release, 0.58.3.
After generating the files, I noticed that almost everything is more or less the same, but the home page is definitely broken: the content of the homepage is there, but it is as if the layout is not used anymore.
It is likely that this problem is due to the page bundles introduced in 0.32, but I am unable to understand what is causing the issue.
As you can see, I have no themes installed and I am using just the layouts directory. In there, I have index.html that should use partial templates for header and footer, and the content/_index.html should use that layout.
I would like to understand how to fix it and why the issue is arising: in my content directory I have no other files besides markdown and html page files, so I think bundles should not even be considered.
Thanks and best regards!
EDIT:
I previously found this issue, but I am unable to see if that is my case.
Try putting blank front matter at the start of /content/_index.html (i.e. two lines of +++).
At the moment, hugo is thinking it should just dump the content of /content/_index.html as your siteās /index.html rather than using the layout defined in /layouts/index.html.
Iāve cloned your site and done this, and your front page now looks much better.
I hadnāt seen anyone use /content/_index.html before (Iām used to /content/_index.md), so I went to the docs to see how .html files are processed in hugo (cause I know that they can be usedā¦Iāve just never done it that way)
Found the third paragraph under Supported Content Formats (which I think is almost the only thing said about html files for content). Which explains how hugo interprets the content of .html files.
Had a hunch that since your _index.html wasnāt a full webpage (no <html><head> tags) that you probably meant for it to be processed through a layout. So guessed it needed frontmatter.
Cloned your repository, had a look at what the output was āas isā, then put in the blank frontmatterā¦and it worked.
As for your second question - you could try running in verbose modeā¦which displays lots of information.
Ok, thanks. I was not aware that content pages needed a front matter to ātriggerā the usage of a layout. I thought that would have been used anyway, as long as the layout structure was appropriate for the contents.
I tried verbose, but it is still not what I am looking for.