Skip to content

Commit c114092

Browse files
feat: add legal page and update sitemap
- Implement bot-optimized legal page with appropriate og:tags - Add legal page URL to sitemap - Update documentation to include legal page in routes
1 parent 200d084 commit c114092

3 files changed

Lines changed: 20 additions & 2 deletions

File tree

api/routers/seo.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ async def get_sitemap(db: AsyncSession | None = Depends(optional_db)):
7171
'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">',
7272
" <url><loc>https://pyplots.ai/</loc></url>",
7373
" <url><loc>https://pyplots.ai/catalog</loc></url>",
74+
" <url><loc>https://pyplots.ai/legal</loc></url>",
7475
]
7576

7677
# Add spec URLs (overview + all implementations)
@@ -131,6 +132,19 @@ async def seo_catalog():
131132
)
132133

133134

135+
@router.get("/seo-proxy/legal")
136+
async def seo_legal():
137+
"""Bot-optimized legal page with correct og:tags."""
138+
return HTMLResponse(
139+
BOT_HTML_TEMPLATE.format(
140+
title="Legal | pyplots.ai",
141+
description="Legal notice, privacy policy, and transparency information for pyplots.ai",
142+
image=DEFAULT_HOME_IMAGE,
143+
url="https://pyplots.ai/legal",
144+
)
145+
)
146+
147+
134148
@router.get("/seo-proxy/{spec_id}")
135149
async def seo_spec_overview(spec_id: str, db: AsyncSession | None = Depends(optional_db)):
136150
"""Bot-optimized spec overview page with collage og:image."""

docs/reference/plausible.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ https://pyplots.ai/{category}/{value}/{category}/{value}/...
4242
|-----|-------------|
4343
| `/` | Home page (no filters) |
4444
| `/catalog` | Catalog page (alphabetical spec list) |
45+
| `/legal` | Legal notice, privacy policy, transparency |
4546
| `/{spec_id}` | Spec overview page (grid of all implementations) |
4647
| `/{spec_id}/{library}` | Spec detail page (single library implementation) |
4748
| `/interactive/{spec_id}/{library}` | Interactive fullscreen view (HTML plots) |

docs/reference/seo.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ Backend endpoints that serve HTML with correct meta tags for bots.
137137
|----------|---------|----------|
138138
| `GET /seo-proxy/` | Home page | Default (`og-image.png`) |
139139
| `GET /seo-proxy/catalog` | Catalog page | Default |
140+
| `GET /seo-proxy/legal` | Legal page | Default |
140141
| `GET /seo-proxy/{spec_id}` | Spec overview | Collage (2x3 grid) |
141142
| `GET /seo-proxy/{spec_id}/{library}` | Implementation | Single branded |
142143

@@ -253,6 +254,7 @@ Dynamic XML sitemap for search engine indexing.
253254
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
254255
<url><loc>https://pyplots.ai/</loc></url>
255256
<url><loc>https://pyplots.ai/catalog</loc></url>
257+
<url><loc>https://pyplots.ai/legal</loc></url>
256258
<!-- For each spec with implementations: -->
257259
<url><loc>https://pyplots.ai/{spec_id}</loc></url>
258260
<url><loc>https://pyplots.ai/{spec_id}/{library}</loc></url>
@@ -264,8 +266,9 @@ Dynamic XML sitemap for search engine indexing.
264266

265267
1. Home page (`/`)
266268
2. Catalog page (`/catalog`)
267-
3. Spec overview pages (`/{spec_id}`) - only if spec has implementations
268-
4. Implementation pages (`/{spec_id}/{library}`) - all implementations
269+
3. Legal page (`/legal`)
270+
4. Spec overview pages (`/{spec_id}`) - only if spec has implementations
271+
5. Implementation pages (`/{spec_id}/{library}`) - all implementations
269272

270273
### nginx Proxy
271274

0 commit comments

Comments
 (0)