From 762727290f1c738d97127411f2839f0b24e780d7 Mon Sep 17 00:00:00 2001 From: Web-serfer Date: Wed, 15 Apr 2026 00:15:06 +0500 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B0=20=D1=84?= =?UTF-8?q?=D0=B0=D0=B9=D0=BB=D0=B0=20=20robots.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/astro.config.mjs | 19 ++++++++++++++++++- frontend/public/robots.txt | 11 +++++++++++ frontend/src/layouts/Layout.astro | 2 ++ 3 files changed, 31 insertions(+), 1 deletion(-) 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} + +