Skip to content

Custom 404 no longer generated from 404.html layout file #13819

Open
@prietveld

Description

@prietveld

I noticed the following after updating to the latest version available to me at time of writing, 0.144.8, which is used via the hugo-bin npm package. If this has been addressed in later versions please feel free to remove this issue.

For our site I have disabled the default 404 via disableKinds to generate our own from a .md-file, similar to how Bootstrap does it for their docs.

I have the following content in './content/404.md':

---
title: "Page not found"
layout: 404
description: ""
url: /404.html
robots: noindex,follow
sitemap:
  disable: true
---

My 404 page content.

And a '404.html' layout template in the root of ./layouts/

I noticed no more 404.html page was being generated (and the log complained about an unused 404.html layout) until I renamed the layout file to 'error-404.html' and updated the corresponding layout reference in the 404.md file.

It seems there may be a conflict with using the name '404.html' for a layout file?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions