diff --git a/frontend/astro.config.mjs b/frontend/astro.config.mjs index 50eaade..4f37efe 100644 --- a/frontend/astro.config.mjs +++ b/frontend/astro.config.mjs @@ -10,7 +10,24 @@ import solidJs from '@astrojs/solid-js'; // https://astro.build/config export default defineConfig({ site: 'https://advokat086.ru', - integrations: [astroIcon(), mdx(), sitemap(), solidJs()], + integrations: [ + astroIcon(), + mdx(), + sitemap({ + filter: (page) => { + // Исключаем технические страницы + const blockedPaths = [ + '/auth/', // авторизация и регистрация + '/admin', // админ-панель + '/api/', // API-эндпоинты + '/blog/search', // поиск по блогу + '/404', // страница ошибки + ]; + return !blockedPaths.some(path => page.includes(path)); + }, + }), + solidJs(), + ], prefetch: true, vite: { plugins: [tailwindcss()] diff --git a/frontend/public/robots.txt b/frontend/public/robots.txt index e69de29..5e154cd 100644 --- a/frontend/public/robots.txt +++ b/frontend/public/robots.txt @@ -0,0 +1,11 @@ +User-agent: * +Allow: / + +# Заблокированные страницы +Disallow: /auth/ +Disallow: /admin +Disallow: /api/ +Disallow: /blog/search +Disallow: /404 + +Sitemap: https://advokat086.ru/sitemap-index.xml diff --git a/frontend/src/layouts/Layout.astro b/frontend/src/layouts/Layout.astro index 4111361..984bae5 100644 --- a/frontend/src/layouts/Layout.astro +++ b/frontend/src/layouts/Layout.astro @@ -48,6 +48,8 @@ if (Astro.request) { {canonicalLink ? : null} + +