From 245dbbe302987002e6aecc96e9c31df4ae91de7c Mon Sep 17 00:00:00 2001 From: "S.Gromov" Date: Fri, 1 May 2026 23:52:19 +0300 Subject: [PATCH] =?UTF-8?q?chore:=20=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D0=BF=D1=80=D0=B0=D0=B2=D0=B8=D0=BB=D0=B0=20?= =?UTF-8?q?=D0=BE=D1=82=D0=B4=D0=B0=D1=87=D0=B8=20=D0=B4=D0=BE=D0=BA=D1=83?= =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D1=82=D0=B0=D1=86=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - добавлены редиректы для устаревших путей llms - добавлен редирект HTML-страниц на чистые URL - добавлена защита текстовых артефактов от SPA-фолбэка - включены чистые URL в конфигурации VitePress --- .vitepress/config.ts | 1 + Caddyfile | 41 +++++++++++++++++++++++++++++++++++------ 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/.vitepress/config.ts b/.vitepress/config.ts index b9b096f..2e51215 100644 --- a/.vitepress/config.ts +++ b/.vitepress/config.ts @@ -18,6 +18,7 @@ export default defineConfig({ title: 'SLM Design', description: 'Правила и стандарты архитектуры проекта', base: '/docs/', + cleanUrls: true, themeConfig: { sidebar, diff --git a/Caddyfile b/Caddyfile index 67fe031..2aa5a39 100644 --- a/Caddyfile +++ b/Caddyfile @@ -1,11 +1,40 @@ :8082 { root * /srv - @plainText path /llms.txt /llms-full.txt - header @plainText Content-Type "text/plain; charset=utf-8" - @markdown path /ARCHITECTURE.md - header @markdown Content-Type "text/markdown; charset=utf-8" - header @markdown Cache-Control "no-cache, no-store, must-revalidate" - file_server + + # Устаревшие пути llms.txt в подпапках ведём к корневым артефактам. + redir /docs/llms.txt /llms.txt 301 + redir /docs/llms-full.txt /llms-full.txt 301 + + # Чистые URL: запросы вида `/docs/foo.html` редиректим на `/docs/foo`. + @legacyHtml { + path_regexp legacyHtml ^(/.+)\.html$ + not path /index.html + } + redir @legacyHtml {re.legacyHtml.1} 301 + header Link "; rel=\"llms\"" + + @existingText { + path *.txt + file + } + header @existingText Content-Type "text/plain; charset=utf-8" + + @existingMarkdown { + path *.md + file + } + header @existingMarkdown Content-Type "text/markdown; charset=utf-8" + + @architecture path /ARCHITECTURE.md + header @architecture Cache-Control "no-cache, no-store, must-revalidate" + + @missingText { + path *.txt *.md + not file + } + respond @missingText 404 + + file_server try_files {path} {path}.html {path}/index.html /index.html }