Skip to content

Add SEO metadata and sitemap generation for documentation#20

Merged
samuelduchesne merged 3 commits intomainfrom
claude/add-seo-discoverability-cWEqV
Feb 28, 2026
Merged

Add SEO metadata and sitemap generation for documentation#20
samuelduchesne merged 3 commits intomainfrom
claude/add-seo-discoverability-cWEqV

Conversation

@samuelduchesne
Copy link
Copy Markdown
Contributor

Summary

This PR enhances the documentation site's search engine optimization (SEO) by adding comprehensive metadata, structured data, and sitemap generation. These changes improve discoverability and enable better indexing by search engines.

Key Changes

SEO Metadata & Structured Data

  • Enhanced root landing page with rich meta tags including:
    • Descriptive title and meta description
    • Open Graph tags for social media sharing
    • Twitter Card metadata
    • JSON-LD structured data (schema.org WebSite)
    • Canonical URL declaration
  • Updated zensical.toml with improved site description and enabled meta/tags plugins

Sitemap Generation

  • Added generate_sitemap() function that creates sitemap.xml with:
    • Root landing page (priority 1.0)
    • All version landing pages (priority 0.9 for latest, 0.5 for others)
    • Per-version URLs from Zensical-generated sitemaps (if present)
    • Proper XML formatting with lastmod and changefreq attributes

Robots.txt

  • Added generate_robots_txt() function to create robots.txt allowing all crawlers and referencing the sitemap

Page-Level Descriptions

  • Implemented _extract_description() in markdown postprocessor to intelligently extract meta descriptions from page content:
    • Skips headings, admonitions, code blocks, and other non-content elements
    • Cleans markdown syntax (links, code, formatting)
    • Falls back to constructed description if no suitable paragraph found
    • Respects 160-character limit for optimal display in search results
  • Updated add_front_matter() to include auto-generated descriptions in YAML front matter

Integration

  • Both deploy_single_version() and merge_version_outputs() now call the new sitemap and robots.txt generators to ensure they're created during deployment

Implementation Details

  • Sitemap generation handles both absolute and relative URLs from per-version sitemaps
  • Gracefully skips malformed per-version sitemaps without failing the build
  • Description extraction uses regex to safely remove markdown syntax while preserving readability
  • YAML special characters in descriptions are properly escaped

https://claude.ai/code/session_016RJzLotk8sGXvy9uZE4TxM

…, page descriptions

- Enhance root landing page with description, canonical, OG, Twitter Card, and JSON-LD
- Add generate_robots_txt() to create robots.txt during deployment
- Add generate_sitemap() to create sitemap.xml with all version landing pages
  and per-version page entries from Zensical-generated sitemaps
- Wire robots.txt and sitemap generation into deploy_single_version and
  merge_version_outputs
- Add _extract_description() to auto-extract meta descriptions from page content
- Update add_front_matter() to include description in YAML front matter
- Improve site_description in zensical.toml base config
- Enable meta and tags plugins in zensical.toml

https://claude.ai/code/session_016RJzLotk8sGXvy9uZE4TxM
github-actions Bot added a commit that referenced this pull request Feb 28, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Docs preview for this PR is available at:
https://docs.idfkit.com/pr-preview/pr-20/

@samuelduchesne samuelduchesne merged commit 7e24069 into main Feb 28, 2026
4 checks passed
github-actions Bot added a commit that referenced this pull request Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants