Hugo

Where can I find documentation of breaking change "found no layout file"?

I found Hugo a while back and had a relatively painless time building a site. I wrote a new post for the site and rerendered it and was suprised to see my content gone.

I saw a number of logs similar to:

WARN 2019/06/27 15:34:26 found no layout file for "HTML" for "home": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.

Idiomatically, warnings may be actioned, not must be actioned, thus I was suprised that my previously working setup now produced zero posts.

Given that Hugo is not 1.0 yet I understand that breaking changes happen but it is conventional to explain the break to users. Where can I find documentation explaining this breaking change?

If you’d like to reproduce my issue, I’m running v0.57-0-DEV linux/amd64 against this content: https://github.com/therealplato/therealplato.com/tree/master/hugosite

You are probably not doing a recursive clone.

If you have already cloned that repo, cd to the repo dir and do git submodule update --init --recursive. That will clone the theme submodule too.

Your site builds with this for me:

Building sites … WARN 2019/08/07 15:59:00 Page's .Hugo is deprecated and will be removed in a future release. Use the global hugo function.

                   | EN
+------------------+-----+
  Pages            |  41
  Paginator pages  |   3
  Non-page files   |   0
  Static files     | 206
  Processed images |   0
  Aliases          |   1
  Sitemaps         |   1
  Cleaned          |   0

Total in 2317 ms

There is a warning, but just one.


found no layout file for “HTML” for “home”

That’s a clear sign that hugo is not finding the index.html template to generate the “home” page. But your theme does have that: https://github.com/nodejh/hugo-theme-cactus-plus/blob/73bf689ba22ed9d95d3b3252f6e80872d694e270/layouts/index.html.

So the only thing could be that you simply did not pull in that theme submodule.

/putting down the detective hat :slight_smile:


Forgot to add… If you want to clone your repo from scratch with the submodules, do:

git clone --recurse-submodules https://github.com/therealplato/therealplato.com
cd therealplato.com/hugosite
hugo
3 Likes

Thank you @kaushalmodi. That was the primary issue. Darn old me for using submodules. I have vendored my theme to avoid this happening in the future.

While comparing the diff of generated files, I encountered one more behavioral change that I am hoping to solve. Please let me know if it’s worth a new issue.
This is my source file:
https://raw.githubusercontent.com/therealplato/therealplato.com/master/hugosite/content/posts/soberoctober26.md

This is the diff after regenerating with recent hugo:

Is there new configuration required to maintain leading whitespace within markdown code blocks?

Workaround seems to be put four leading spaces on each line of the codefenced block

You shouldn’t need to do that; you are probably just missing this in your config.toml:

pygmentsCodeFences = true       # This applies to Chroma too.

Note: Put that in your config before any of the TOML tables (the ones with square brackets like [Params]).


If it’s not that, then it’s something else (may be the theme is messing with .Content somehow?), but I was able to make that go snippet render fine on my hugo server just fine. Do you want to try it out using the Ananke theme in the Hugo Quick Start tutorial?