Merge commit '5be51ac3db225d5df501ed1fa1499c41d97dbf65'

This commit is contained in:
Bjørn Erik Pedersen
2025-04-10 13:04:51 +02:00
987 changed files with 12379 additions and 14083 deletions

View File

@@ -2,18 +2,14 @@
title: Custom 404 page
linkTitle: 404 templates
description: Create a template to render a 404 error page.
categories: [templates]
categories: []
keywords: []
menu:
docs:
parent: templates
weight: 160
weight: 160
weight: 190
---
To render a 404 error page in the root of your site, create a 404 template in the root of the `layouts` directory. For example:
{{< code file=layouts/404.html >}}
```go-html-template {file="layouts/404.html"}
{{ define "main" }}
<h1>404 Not Found</h1>
<p>The page you requested cannot be found.</p>
@@ -23,7 +19,7 @@ To render a 404 error page in the root of your site, create a 404 template in th
</a>
</p>
{{ end }}
{{< /code >}}
```
For multilingual sites, add the language key to the file name: