From 6a98131943753308c3e5889a0a922ee215406e0b Mon Sep 17 00:00:00 2001 From: Arnaud Ligny Date: Mon, 23 Oct 2023 18:38:31 +0200 Subject: [PATCH] feat: add 404 error pages support --- layouts/page.netlify_redirects.twig | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/layouts/page.netlify_redirects.twig b/layouts/page.netlify_redirects.twig index 25aecc6..137a4c3 100644 --- a/layouts/page.netlify_redirects.twig +++ b/layouts/page.netlify_redirects.twig @@ -13,4 +13,11 @@ {%- for language in site.languages|filter(l => l.code != site.language) ~%} / /{{ language.code }}/ 302! Language={{ language.code }} {%- endfor -%} -{%- endif -%} \ No newline at end of file +{%- endif ~%} +# Custom 404 error pages +{{ url(site.home, {'canonical': false}) }}* {{ url(site.page('404'), {'language': site.language, 'canonical': false}) }} 404 +{%- if site.languages > 1 -%} + {%- for language in site.languages|filter(l => l.code != site.language) ~%} +/{{ language.code }}/* {{ url(site.page('404', language.code), {'canonical': false}) }} 404 + {%- endfor -%} +{%- endif ~%} \ No newline at end of file