Skip to content

Commit 34b813d

Browse files
feat(seo): update SEO configurations and bot handling
- Add no-cpu-throttling flag in cloudbuild.yaml - Change robots meta tag to noindex in InteractivePage.tsx - Update nginx.conf to serve robots.txt directly and adjust bot detection - Add ignored memory patterns and language server settings in project.yml - Modify robots.txt to disallow /interactive - Implement SEO proxy for MCP page in seo.py
1 parent 0b1df0f commit 34b813d

File tree

6 files changed

+38
-9
lines changed

6 files changed

+38
-9
lines changed

.serena/project.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,17 @@ read_only_memory_patterns: []
131131
# Possible values: unset (use global setting), "lf", "crlf", or "native" (platform default)
132132
# This does not affect Serena's own files (e.g. memories and configuration files), which always use native line endings.
133133
line_ending:
134+
135+
# list of regex patterns for memories to completely ignore.
136+
# Matching memories will not appear in list_memories or activate_project output
137+
# and cannot be accessed via read_memory or write_memory.
138+
# To access ignored memory files, use the read_file tool on the raw file path.
139+
# Extends the list from the global configuration, merging the two lists.
140+
# Example: ["_archive/.*", "_episodes/.*"]
141+
ignored_memory_patterns: []
142+
143+
# advanced configuration option allowing to configure language server-specific options.
144+
# Maps the language key to the options.
145+
# Have a look at the docstring of the constructors of the LS implementations within solidlsp (e.g., for C# or PHP) to see which options are available.
146+
# No documentation on options means no options are available.
147+
ls_specific_settings: {}

api/cloudbuild.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ steps:
5858
- "--execution-environment=gen2"
5959
- "--set-env-vars=GOOGLE_CLOUD_PROJECT=$PROJECT_ID"
6060
- "--set-env-vars=GCS_BUCKET=pyplots-images"
61+
- "--no-cpu-throttling"
6162
id: "deploy"
6263
waitFor: ["push-image"]
6364

api/routers/seo.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,19 @@ async def seo_legal():
146146
)
147147

148148

149+
@router.get("/seo-proxy/mcp")
150+
async def seo_mcp():
151+
"""Bot-optimized MCP page with correct og:tags."""
152+
return HTMLResponse(
153+
BOT_HTML_TEMPLATE.format(
154+
title="MCP Server | pyplots.ai",
155+
description="Connect your AI assistant to pyplots via the Model Context Protocol (MCP).",
156+
image=DEFAULT_HOME_IMAGE,
157+
url="https://pyplots.ai/mcp",
158+
)
159+
)
160+
161+
149162
@router.get("/seo-proxy/{spec_id}")
150163
async def seo_spec_overview(spec_id: str, db: AsyncSession | None = Depends(optional_db)):
151164
"""Bot-optimized spec overview page with collage og:image."""

app/nginx.conf

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Bot detection for SEO - social media crawlers need pre-rendered meta tags
22
# These bots cannot execute JavaScript, so we serve them pre-rendered HTML with og:tags
3+
# NOTE: Search engines (Googlebot, Bingbot, etc.) are NOT included here — they can
4+
# render JavaScript since 2019 and should see the full SPA for proper indexing.
35
map $http_user_agent $is_bot {
46
default 0;
57
# Social Media
@@ -20,13 +22,6 @@ map $http_user_agent $is_bot {
2022
~*skypeuripreview 1;
2123
~*microsoft\ teams 1;
2224
~*snapchat 1;
23-
# Search Engines
24-
~*googlebot 1;
25-
~*bingbot 1;
26-
~*yandexbot 1;
27-
~*duckduckbot 1;
28-
~*baiduspider 1;
29-
~*applebot 1;
3025
# Link Preview Services
3126
~*embedly 1;
3227
~*quora\ link\ preview 1;
@@ -71,8 +66,13 @@ server {
7166
proxy_ssl_trusted_certificate /etc/ssl/certs/ca-certificates.crt;
7267
}
7368

69+
# Serve robots.txt directly (must not go through bot proxy)
70+
location = /robots.txt {
71+
try_files $uri =404;
72+
}
73+
7474
# SPA routing - serve index.html for all routes
75-
# Bots get redirected to backend for proper meta tags
75+
# Social media bots get redirected to backend for proper og:tags
7676
location / {
7777
# Redirect bots to SEO proxy via error_page trick (nginx-safe pattern)
7878
error_page 418 = @seo_proxy;

app/public/robots.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
User-agent: *
22
Allow: /
33
Disallow: /debug
4+
Disallow: /interactive
45

56
Sitemap: https://pyplots.ai/sitemap.xml

app/src/pages/InteractivePage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ export function InteractivePage() {
201201
<meta property="og:title" content={`${title} - ${library} (interactive) | pyplots.ai`} />
202202
<meta property="og:description" content={`Interactive ${title} visualization using ${library}`} />
203203
<meta property="og:url" content={`https://pyplots.ai/interactive/${specId}/${library}`} />
204-
<meta name="robots" content="index, follow" />
204+
<meta name="robots" content="noindex, follow" />
205205
<link rel="canonical" href={`https://pyplots.ai/interactive/${specId}/${library}`} />
206206
</Helmet>
207207

0 commit comments

Comments
 (0)