-
Notifications
You must be signed in to change notification settings - Fork 91
Expand file tree
/
Copy pathnetlify.toml
More file actions
145 lines (122 loc) · 3.21 KB
/
Copy pathnetlify.toml
File metadata and controls
145 lines (122 loc) · 3.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
[build]
command = "npm ci --include=dev && npx convex deploy --cmd 'npm run build'"
publish = "dist"
[build.environment]
NODE_VERSION = "20"
# Raw markdown passthrough - explicit rule prevents SPA fallback from intercepting
[[redirects]]
from = "/raw/*"
to = "/raw/:splat"
status = 200
force = true
# Static files passthrough
[[redirects]]
from = "/assets/*"
to = "/assets/:splat"
status = 200
force = true
# SPA fallback for client-side routing (must be last)
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
# Edge functions for dynamic Convex HTTP proxying
# RSS feeds
[[edge_functions]]
path = "/rss.xml"
function = "rss"
[[edge_functions]]
path = "/rss-full.xml"
function = "rss"
# Sitemap
[[edge_functions]]
path = "/sitemap.xml"
function = "sitemap"
# API endpoints
[[edge_functions]]
path = "/api/posts"
function = "api"
[[edge_functions]]
path = "/api/post"
function = "api"
[[edge_functions]]
path = "/api/export"
function = "api"
# Geo location API for visitor map
[[edge_functions]]
path = "/api/geo"
function = "geo"
# MCP Server endpoint for AI tool integration
# Rate limiting configured in edge function config (50 req/min per IP)
[[edge_functions]]
path = "/mcp"
function = "mcp"
# Open Graph bot detection for social preview cards only
# Excludes raw markdown, static assets, and AI-consumable files
[[edge_functions]]
path = "/*"
function = "botMeta"
excludedPath = [
"/raw/*",
"/assets/*",
"/api/*",
"/.netlify/*",
"/favicon.ico",
"/favicon.svg",
"/robots.txt",
"/sitemap.xml",
"/rss.xml",
"/rss-full.xml",
"/llms.txt",
"/openapi.yaml"
]
# Security and SEO headers (global, excludes /raw/*)
[[headers]]
for = "/*"
[headers.values]
X-Frame-Options = "DENY"
X-Content-Type-Options = "nosniff"
X-XSS-Protection = "1; mode=block"
Referrer-Policy = "strict-origin-when-cross-origin"
X-Robots-Tag = "index, follow"
# Link header removed from global scope to avoid applying to /raw/*
# Dashboard - prevent indexing of admin pages
[[headers]]
for = "/dashboard/*"
[headers.values]
X-Robots-Tag = "noindex, nofollow"
# Write page - prevent indexing of admin pages
[[headers]]
for = "/write"
[headers.values]
X-Robots-Tag = "noindex, nofollow"
# Newsletter admin - prevent indexing of admin pages
[[headers]]
for = "/newsletter-admin"
[headers.values]
X-Robots-Tag = "noindex, nofollow"
# API endpoints - prevent indexing
[[headers]]
for = "/api/*"
[headers.values]
X-Robots-Tag = "noindex"
# 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/plain; charset=utf-8"
Access-Control-Allow-Origin = "*"
Cache-Control = "public, max-age=3600"
# Removed X-Robots-Tag = "noindex" - AI crawlers need to index raw content
[context.production.environment]
NODE_ENV = "production"
[context.deploy-preview.environment]
NODE_ENV = "development"
[context.branch-deploy.environment]
NODE_ENV = "development"