0.63.1 not finding 404 template

I have a template in themes/mytheme/layouts/404.html. In 0.62.2 it got rendered properly into the output directory, but in 0.63.1 it’s missing.

I do have a layouts directory in the base of the repository, but there’s no 404.html file there to override. Did the lookup order get changed? Is this a bug or was I doing something previously that should not have worked?

Thanks for any help!

The base template lookup order changed in v0.63.0

Ah, ok. The release notes seemed to imply there was only a change for the Baseof template, but I see this applies to all templates. (I was apparently too quick to jump to the bullet points!)

It’s still not clear to me what I need to change, though. Why wouldn’t it find the 404 in the theme directory now?

cc: @bep

I confirm that on the latest hugo build, the layouts/404.html does not render a public/404.html.

The issue is reproducible by following the instructions in my site’s README.


If layouts/404.html is no longer the valid location for it, we need to change the documentation for Custom 404.

A similar convo is happening here too…

That seems to be a different issue.

For me, between Hugo 0.62.2 and latest Hugo build, only one page is generated less compared to Hugo 0.62.2.

km²~/hugo/:scripter.co> hugo version                                                                            01/24 9:17am
Hugo Static Site Generator v0.64.0-DEV-8195A394:CHROMA-26F03CB linux/amd64 BuildDate: 2020-01-24T08:59:01-0500
km²~/hugo/:scripter.co> hugo    

                   | EN
-------------------+------
  Pages            | 853
  Paginator pages  |   7
  Non-page files   |  19
  Static files     |  93
  Processed images |   0
  Aliases          |   5
  Sitemaps         |   1
  Cleaned          |   0

Total in 2871 ms
km²~/hugo/:scripter.co> hugo_0_62_2 version                                                                                                                                                                                                      01/24 9:17am
Hugo Static Site Generator v0.62.2-83E50184 linux/amd64 BuildDate: 2020-01-05T18:51:38Z
km²~/hugo/:scripter.co> hugo_0_62_2      

                   | EN
+------------------+-----+
  Pages            | 854
  Paginator pages  |   7
  Non-page files   |  19
  Static files     |  93
  Processed images |   0
  Aliases          |   5
  Sitemaps         |   1
  Cleaned          |   0

Total in 2561 ms

That one less page is the 404.html that doesn’t get generated using Hugo 0.64-DEV (or the Hugo 0.63.1).

stange…

Yeah, I use this super basic script to compare the outputs of Hugo revisions before upgrading, and it’s helped me catch stuff I would have missed otherwise (like the formatting that changed in the switch to Goldmark).

Glad I spotted the missing 404 before running a deploy. Hopefully we can get to the bottom of it…

There is an issue open over at Github about this.

@bep fixed it. update :slight_smile:

Yep, I just confirmed by rebuilding from Hugo master. 404.html now generates fine. Thanks @bep!