diff --git a/astro.config.mjs b/astro.config.mjs index adc6335..01e0d98 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -12,8 +12,6 @@ export default defineConfig({ i18n: { locales: ['ua', 'en'], defaultLocale: 'ua', - routing: { - prefixDefaultLocale: true, - }, + routing: 'manual', }, }); diff --git a/src/lib/dictionaries/en.ts b/src/lib/dictionaries/en.ts index bd41ff6..6ef13b7 100644 --- a/src/lib/dictionaries/en.ts +++ b/src/lib/dictionaries/en.ts @@ -7,6 +7,8 @@ export const en: Dict = { homeDescription: 'Devodytyji is an open-air cultural space: concerts, movies, talks and markets under the open sky.', defaultOgImage: '/og-cover.jpg', + notFoundTitle: 'Page not found', + notFoundDescription: 'The page you are looking for does not exist or has been moved.', }, nav: { home: 'Home', diff --git a/src/lib/dictionaries/ua.ts b/src/lib/dictionaries/ua.ts index 968d7d0..3d18b8f 100644 --- a/src/lib/dictionaries/ua.ts +++ b/src/lib/dictionaries/ua.ts @@ -5,6 +5,8 @@ export const ua = { homeDescription: 'Devodytyji — відкритий простір на свіжому повітрі: концерти, кіно, лекції та маркети просто неба.', defaultOgImage: '/og-cover.jpg', + notFoundTitle: 'Сторінку не знайдено', + notFoundDescription: 'Схоже, такої сторінки не існує або її було переміщено.', }, nav: { home: 'Головна', diff --git a/src/pages/404.astro b/src/pages/404.astro new file mode 100644 index 0000000..163fec8 --- /dev/null +++ b/src/pages/404.astro @@ -0,0 +1,29 @@ +--- +import BaseLayout from '../layouts/BaseLayout.astro'; +import { getDict, getLocaleFromUrl, localizedPath } from '../lib/i18n'; +import type { Locale } from '../lib/i18n'; + +const locale: Locale = Astro.locals.locale ?? getLocaleFromUrl(Astro.url); +const dict = getDict(locale); +const user = Astro.locals.user; +--- + + +
+
+ 404 +

{dict.meta.notFoundTitle}

+

{dict.meta.notFoundDescription}

+

+ {dict.nav.home} +

+
+
+