From 6d3fb4613b6b08a2a1a8901c39069f83a0ef8c8f Mon Sep 17 00:00:00 2001 From: Daniel Kraus Date: Sun, 28 Jun 2026 14:50:53 +0200 Subject: [PATCH] Use 404.svg image if available. --- README.md | 12 ++++++++++++ layouts/404.html | 22 ++++++++++++++++------ 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3ae7dce..5cb9f0f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,15 @@ # hugo_bootstrap_theme Simple Bootstrap-based theme for Hugo. + + +## Custom error page + +The theme has a custom 404 error page. + +If the site has an SVG image in `assets/svg/404.svg`, +this image will be displayed instead of a generic 404 +code. Regardless of whether an SVG assets exists or not, +English and German explanations of what's going on will +be included on the page. + diff --git a/layouts/404.html b/layouts/404.html index effcca6..a51269e 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -1,11 +1,19 @@ {{ define "main" }}
-
-

- 404 -

-
+
+ {{ with resources.Get "svg/404.svg" }} + {{ .Content | safeHTML }} + {{ else }} +

+ 404 +

+ {{ end }} +
+
+
+
+

Page not found

@@ -18,7 +26,9 @@ Back to the home page.

-
+
+
+

Seite nicht gefunden