Skip to content

Conversation

@seesharprun
Copy link
Contributor

@seesharprun seesharprun commented Dec 3, 2025

This pull request adds two primary SEO features:

SEO Images

These changes introduces a new system for generating custom Open Graph images for every page. The main changes focus on content discovery, metadata generation, and workflow simplification.

Screenshot of a social share preview extension for the DocumentDB website.

Sitemap

These changes add a new dynamic sitemap generator and introduces a robots.txt file to improve SEO and crawler support for the documentation site. The sitemap generator automatically creates up-to-date sitemap entries for all major site sections, documentation articles, and reference pages based on file modification dates from git history. The robots.txt file allows all crawlers and provides the sitemap location.

Screenshot of XML sitemap reandered using "pretty print" formatting.

Generated XML
<urlset
	xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<url>
		<loc>https://documentdb.io/</loc>
		<lastmod>2025-12-05T16:55:12.312Z</lastmod>
		<changefreq>yearly</changefreq>
		<priority>1</priority>
	</url>
	<url>
		<loc>https://documentdb.io/docs</loc>
		<lastmod>2025-12-05T16:55:12.312Z</lastmod>
		<changefreq>monthly</changefreq>
		<priority>0.25</priority>
	</url>
	<url>
		<loc>https://documentdb.io/docs/architecture</loc>
		<lastmod>2025-11-21T23:52:16.000Z</lastmod>
		<changefreq>weekly</changefreq>
		<priority>0.85</priority>
	</url>
	<url>
		<loc>https://documentdb.io/docs/postgresql/functions</loc>
		<lastmod>2025-12-05T16:55:12.459Z</lastmod>
		<changefreq>weekly</changefreq>
		<priority>0.85</priority>
	</url>
	<url>
		<loc>https://documentdb.io/docs/postgresql</loc>
		<lastmod>2025-11-21T23:52:16.000Z</lastmod>
		<changefreq>weekly</changefreq>
		<priority>0.85</priority>
	</url>
	<url>
		<loc>https://documentdb.io/docs/quickstart/extension</loc>
		<lastmod>2025-12-05T16:55:12.587Z</lastmod>
		<changefreq>weekly</changefreq>
		<priority>0.85</priority>
	</url>
	<url>
		<loc>https://documentdb.io/docs/quickstart</loc>
		<lastmod>2025-11-21T23:52:16.000Z</lastmod>
		<changefreq>weekly</changefreq>
		<priority>0.85</priority>
	</url>
	<url>
		<loc>https://documentdb.io/docs/quickstart/mongodb-shell</loc>
		<lastmod>2025-12-05T16:55:12.718Z</lastmod>
		<changefreq>weekly</changefreq>
		<priority>0.85</priority>
	</url>
	<url>
		<loc>https://documentdb.io/blogs</loc>
		<lastmod>2025-12-05T16:55:12.718Z</lastmod>
		<changefreq>monthly</changefreq>
		<priority>0.25</priority>
	</url>
	<url>
		<loc>https://documentdb.io/docs/reference</loc>
		<lastmod>2025-12-05T16:55:12.718Z</lastmod>
		<changefreq>monthly</changefreq>
		<priority>0.25</priority>
	</url>
	<url>
		<loc>https://documentdb.io/docs/reference/command</loc>
		<lastmod>2025-12-05T16:55:12.718Z</lastmod>
		<changefreq>monthly</changefreq>
		<priority>0.25</priority>
	</url>
	<url>
		<loc>https://documentdb.io/docs/reference/operator</loc>
		<lastmod>2025-12-05T16:55:12.718Z</lastmod>
		<changefreq>monthly</changefreq>
		<priority>0.25</priority>
	</url>
	<url>
		<loc>https://documentdb.io/docs/reference/command/aggregation</loc>
		<lastmod>2025-12-05T16:55:12.718Z</lastmod>
		<changefreq>monthly</changefreq>
		<priority>0.25</priority>
	</url>
	<url>
		<loc>https://documentdb.io/docs/reference/operator/evaluation-query</loc>
		<lastmod>2025-12-05T16:55:12.718Z</lastmod>
		<changefreq>monthly</changefreq>
		<priority>0.25</priority>
	</url>
	<url>
		<loc>https://documentdb.io/docs/reference/command/aggregation/count</loc>
		<lastmod>2025-11-21T23:52:16.000Z</lastmod>
		<changefreq>monthly</changefreq>
		<priority>0.55</priority>
	</url>
	<url>
		<loc>https://documentdb.io/docs/reference/operator/evaluation-query/regex</loc>
		<lastmod>2025-11-21T23:52:16.000Z</lastmod>
		<changefreq>monthly</changefreq>
		<priority>0.55</priority>
	</url>
	<url>
		<loc>https://documentdb.io/packages</loc>
		<lastmod>2025-12-05T16:55:12.854Z</lastmod>
		<changefreq>weekly</changefreq>
		<priority>0.7</priority>
	</url>
</urlset>

SEO and crawler support

  • Added a new public/robots.txt file that allows all crawlers and specifies the sitemap location for search engines.

Automated sitemap generation

  • Created a new app/sitemap.ts file that dynamically generates a sitemap at build time, including homepage, main sections, documentation articles, and reference pages, with accurate last-modified dates based on git commit history.
  • Integrated functions to retrieve all article paths and reference parameters, ensuring all documentation and reference pages are included in the sitemap.
  • Added fixed values for prioritization that can be adjusted later.
  • Utilized git commit dates to set the lastModified field for each sitemap entry, improving the accuracy of search engine indexing.
  • Added logic to group and generate sitemap entries for reference type and category index pages, ensuring comprehensive coverage of the documentation structure.

@seesharprun seesharprun marked this pull request as draft December 3, 2025 17:07
@seesharprun seesharprun marked this pull request as ready for review December 5, 2025 16:28
@seesharprun seesharprun reopened this Dec 22, 2025
@seesharprun seesharprun changed the title Add sitemap functionality for SEO Add SEO features Jan 8, 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.

1 participant