Skip to content

Commit b23989c

Browse files
committed
Add custom headers for robots.txt and sitemap.xml in Vercel configuration
- Added Content-Type headers for robots.txt and sitemap.xml to ensure correct content delivery. - Updated rewrites to exclude these files from being redirected to index.html.
1 parent 073b8d3 commit b23989c

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

docs-site/static/robots.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
User-agent: *
2+
Disallow: /search
3+
Allow: /
4+
5+
Sitemap: https://docs-python-sdk.vaiz.com/sitemap.xml

docs-site/vercel.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,29 @@
44
"framework": "docusaurus",
55
"installCommand": "npm install",
66
"trailingSlash": false,
7+
"headers": [
8+
{
9+
"source": "/robots.txt",
10+
"headers": [
11+
{
12+
"key": "Content-Type",
13+
"value": "text/plain"
14+
}
15+
]
16+
},
17+
{
18+
"source": "/sitemap.xml",
19+
"headers": [
20+
{
21+
"key": "Content-Type",
22+
"value": "application/xml"
23+
}
24+
]
25+
}
26+
],
727
"rewrites": [
828
{
9-
"source": "/:path*",
29+
"source": "/:path((?!robots\\.txt|sitemap\\.xml|_next|api|static|assets|img|.*\\..*).*)",
1030
"destination": "/index.html"
1131
}
1232
]

0 commit comments

Comments
 (0)