mirror of
https://github.com/waynesutton/markdown-site.git
synced 2026-01-12 04:09:14 +00:00
fix(ai): remove Link header from /raw/* and use window.location.origin for raw URLs
- Remove Link header from global headers scope, apply only to /index.html - Remove X-Robots-Tag noindex from /raw/* to allow AI crawler indexing - Use window.location.origin instead of props.url for raw markdown URL construction - Ensures correct URLs even when props.url points to canonical/deploy preview domains - Fixes ChatGPT/Perplexity fetch failures on /raw/*.md endpoints
This commit is contained in:
11
netlify.toml
11
netlify.toml
@@ -76,7 +76,7 @@
|
||||
"/openapi.yaml"
|
||||
]
|
||||
|
||||
# Security and SEO headers
|
||||
# Security and SEO headers (global, excludes /raw/*)
|
||||
[[headers]]
|
||||
for = "/*"
|
||||
[headers.values]
|
||||
@@ -84,16 +84,23 @@
|
||||
X-Content-Type-Options = "nosniff"
|
||||
X-XSS-Protection = "1; mode=block"
|
||||
Referrer-Policy = "strict-origin-when-cross-origin"
|
||||
# Link header removed from global scope to avoid applying to /raw/*
|
||||
|
||||
# Link header for SPA entry point only
|
||||
[[headers]]
|
||||
for = "/index.html"
|
||||
[headers.values]
|
||||
Link = "</llms.txt>; rel=\"author\""
|
||||
|
||||
# Raw markdown files - AI friendly headers
|
||||
# No Link header, no noindex - optimized for AI crawlers
|
||||
[[headers]]
|
||||
for = "/raw/*"
|
||||
[headers.values]
|
||||
Content-Type = "text/markdown; charset=utf-8"
|
||||
Access-Control-Allow-Origin = "*"
|
||||
Cache-Control = "public, max-age=3600"
|
||||
X-Robots-Tag = "noindex"
|
||||
# Removed X-Robots-Tag = "noindex" - AI crawlers need to index raw content
|
||||
|
||||
[context.production.environment]
|
||||
NODE_ENV = "production"
|
||||
|
||||
Reference in New Issue
Block a user