From 5ca8472fb78a771629cf301ba20ec111b3cca496 Mon Sep 17 00:00:00 2001 From: geekifan Date: Sun, 11 May 2025 18:18:48 +0800 Subject: [PATCH] feat: add 404 error page layout and update topbar for 404 handling --- layouts/404.html | 6 ++++++ layouts/partials/topbar.html | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 layouts/404.html diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..557eb01 --- /dev/null +++ b/layouts/404.html @@ -0,0 +1,6 @@ +{{ define "main" }} +

404: Page not found

+
+

{{ i18n "not_found.statement" }}

+
+{{ end }} \ No newline at end of file diff --git a/layouts/partials/topbar.html b/layouts/partials/topbar.html index c6582db..66be5a3 100644 --- a/layouts/partials/topbar.html +++ b/layouts/partials/topbar.html @@ -59,7 +59,7 @@
{{ if eq .Layout "home" }} {{- .Site.Title -}} - {{ else if or (eq .Type "tabs") (eq .Kind "page") }} + {{ else if or (eq .Type "tabs") (eq .Kind "page") (eq .Kind "404") }} {{- T (printf "tabs.%s" (path.Base $url)) | default .Title -}} {{ else }} {{- T (printf "layout.%s" .Layout) | default (.Layout | title) -}}