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: #96
Co-authored-by: paspo <paolo@asperti.com>
Co-committed-by: paspo <paolo@asperti.com>
This commit is contained in:
Paolo Asperti 2024-07-13 18:11:55 +00:00 committed by omartek
parent 170437e5a7
commit 96c7b07995
3 changed files with 29 additions and 2 deletions

View File

@ -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;

11
layouts/404.en.html Normal file
View File

@ -0,0 +1,11 @@
{{ define "main" }}
<h2>Content not found</h2>
<p>The page you're looking for doesn't exist.</p>
<p>If you think this is an error, <a href="mailto:info@bglug.it">let us know</a>.
And in full open-source spirit, you can also <a href="https://git.libreschool.org/BgLUG">help up fix it</a>!</p>
<p>
<a href="{{ .Site.Home.RelPermalink }}">
Go back to home
</a>
</p>
{{ end }}

11
layouts/404.it.html Normal file
View File

@ -0,0 +1,11 @@
{{ define "main" }}
<h2>Contenuto non trovato</h2>
<p>La pagina che stai cercano non esiste.</p>
<p>Se pensi che questo sia un errore, <a href="mailto:info@bglug.it">faccelo sapere</a>.
E in pieno spirito open-source, puoi anche <a href="https://git.libreschool.org/BgLUG">aiutarci a sistemare</a>!</p>
<p>
<a href="{{ .Site.Home.RelPermalink }}">
Torna alla home
</a>
</p>
{{ end }}