From 9a84d9acbb1a24b7d3632955c813b39040d942d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyril=20=C5=A0ebek?= Date: Tue, 9 Jul 2024 15:29:05 +0200 Subject: [PATCH] Added robots.txt and modified sitemap.xml generation --- astro.config.mjs | 12 +++++++++++- public/robots.txt | 4 ++++ src/layouts/MainLayout.astro | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 public/robots.txt diff --git a/astro.config.mjs b/astro.config.mjs index 341deaa..fe28082 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -22,7 +22,17 @@ export default defineConfig({ syntaxHighlight: false, rehypePlugins: [rehypeSlug, [rehypePrettyCode, { theme: "github-dark" }]], }), - sitemap(), + sitemap({ + i18n: { + defaultLocale: "en", + locales: { + en: "en-US", + de: "de-DE", + cs: "cs-CZ", + fr: "fr-FR" + } + } + }), react(), ], i18n: { diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..29ed174 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,4 @@ +User-agent: * +Allow: / + +Sitemap: https://cyrilsebek.cz/sitemap-index.xml \ No newline at end of file diff --git a/src/layouts/MainLayout.astro b/src/layouts/MainLayout.astro index 3f70eb0..7443aab 100644 --- a/src/layouts/MainLayout.astro +++ b/src/layouts/MainLayout.astro @@ -13,6 +13,7 @@ const t = useTranslations(lang) +