From 96c7b079951ac75698fc43b7aaa9a3c1d2def419 Mon Sep 17 00:00:00 2001 From: paspo Date: Sat, 13 Jul 2024 18:11:55 +0000 Subject: [PATCH] 404 (#96) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit supporto pagina di errore 404, sia ita che eng nota bene: quando visualizzi il sito con `hugo server`, la pagina 404 non รจ quella customizzata, ma se usi il container `docker` funziona tutto. fix #87 Reviewed-on: https://git.libreschool.org/BgLUG/bglug.it/pulls/96 Co-authored-by: paspo Co-committed-by: paspo --- docker/rootfs/etc/nginx/http.d/default.conf | 9 +++++++-- layouts/404.en.html | 11 +++++++++++ layouts/404.it.html | 11 +++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 layouts/404.en.html create mode 100644 layouts/404.it.html diff --git a/docker/rootfs/etc/nginx/http.d/default.conf b/docker/rootfs/etc/nginx/http.d/default.conf index d1c49d7..77eb2be 100644 --- a/docker/rootfs/etc/nginx/http.d/default.conf +++ b/docker/rootfs/etc/nginx/http.d/default.conf @@ -12,9 +12,14 @@ server { rewrite ^/feed/.*$ /index.xml last; } - location = /404.html { - internal; + location ~ ^/it/.* { + error_page 404 /it/404.html; } + + location ~ ^/en/.* { + error_page 404 /en/404.html; + } + } gzip on; diff --git a/layouts/404.en.html b/layouts/404.en.html new file mode 100644 index 0000000..39b43b6 --- /dev/null +++ b/layouts/404.en.html @@ -0,0 +1,11 @@ +{{ define "main" }} +

Content not found

+

The page you're looking for doesn't exist.

+

If you think this is an error, let us know. + And in full open-source spirit, you can also help up fix it!

+

+ + Go back to home + +

+{{ end }} diff --git a/layouts/404.it.html b/layouts/404.it.html new file mode 100644 index 0000000..6f78e9a --- /dev/null +++ b/layouts/404.it.html @@ -0,0 +1,11 @@ +{{ define "main" }} +

Contenuto non trovato

+

La pagina che stai cercano non esiste.

+

Se pensi che questo sia un errore, faccelo sapere. +E in pieno spirito open-source, puoi anche aiutarci a sistemare!

+

+ + Torna alla home + +

+{{ end }}