chore: обновить правила отдачи документации
- добавлены редиректы для устаревших путей llms - добавлен редирект HTML-страниц на чистые URL - добавлена защита текстовых артефактов от SPA-фолбэка - включены чистые URL в конфигурации VitePress
This commit is contained in:
@@ -18,6 +18,7 @@ export default defineConfig({
|
|||||||
title: 'SLM Design',
|
title: 'SLM Design',
|
||||||
description: 'Правила и стандарты архитектуры проекта',
|
description: 'Правила и стандарты архитектуры проекта',
|
||||||
base: '/docs/',
|
base: '/docs/',
|
||||||
|
cleanUrls: true,
|
||||||
|
|
||||||
themeConfig: {
|
themeConfig: {
|
||||||
sidebar,
|
sidebar,
|
||||||
|
|||||||
41
Caddyfile
41
Caddyfile
@@ -1,11 +1,40 @@
|
|||||||
:8082 {
|
:8082 {
|
||||||
root * /srv
|
root * /srv
|
||||||
@plainText path /llms.txt /llms-full.txt
|
|
||||||
header @plainText Content-Type "text/plain; charset=utf-8"
|
# Устаревшие пути llms.txt в подпапках ведём к корневым артефактам.
|
||||||
@markdown path /ARCHITECTURE.md
|
redir /docs/llms.txt /llms.txt 301
|
||||||
header @markdown Content-Type "text/markdown; charset=utf-8"
|
redir /docs/llms-full.txt /llms-full.txt 301
|
||||||
header @markdown Cache-Control "no-cache, no-store, must-revalidate"
|
|
||||||
file_server
|
# Чистые URL: запросы вида `/docs/foo.html` редиректим на `/docs/foo`.
|
||||||
|
@legacyHtml {
|
||||||
|
path_regexp legacyHtml ^(/.+)\.html$
|
||||||
|
not path /index.html
|
||||||
|
}
|
||||||
|
redir @legacyHtml {re.legacyHtml.1} 301
|
||||||
|
|
||||||
header Link "</llms.txt>; rel=\"llms\""
|
header Link "</llms.txt>; 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
|
try_files {path} {path}.html {path}/index.html /index.html
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user