Skip to content

Enhancement: Add dynamic sitemap generation for roadmaps and static pages (#101)#140

Merged
RishiByte merged 1 commit into
Demon-Die:mainfrom
coolss21:feature/issue-101
Jun 10, 2026
Merged

Enhancement: Add dynamic sitemap generation for roadmaps and static pages (#101)#140
RishiByte merged 1 commit into
Demon-Die:mainfrom
coolss21:feature/issue-101

Conversation

@coolss21

@coolss21 coolss21 commented Jun 10, 2026

Copy link
Copy Markdown

Resolves #101

Overview
This PR adds automatic sitemap generation for the Next.js App Router using sitemap.ts.

Why this helps
Search engine crawlers need an efficient way to map out all the topics and documentation within DemonTech. This sitemap ensures every static page, roadmap landing page, and individual topic page is discoverable.

Changes included

  • Created project/src/app/sitemap.ts.
  • Automatically retrieves and maps roadmapRegistry routes and topicId routes.
  • Included static Next.js documentation routes with specified priorities.

Summary by CodeRabbit

Release Notes

  • New Features
    • Added a comprehensive sitemap that automatically includes all documentation pages and dynamically generated roadmap and topic content. The sitemap incorporates environment-based configuration for proper URL resolution, enabling search engines to better discover, crawl, and index the complete content catalog.

@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

@rhoggs-bot-test-account is attempting to deploy a commit to the Rishi Bhardwaj's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This pull request adds a Next.js sitemap generator that creates comprehensive sitemap entries for the application. It combines statically defined documentation and info routes with dynamically generated roadmap index and topic page URLs derived from application data.

Changes

Sitemap Generation for Roadmap Content

Layer / File(s) Summary
Static routes and base configuration
project/src/app/sitemap.ts
Imports Next.js metadata types, constructs base URL from NEXT_PUBLIC_SITE_URL with deployment fallback, and defines fixed routes for documentation and info pages with per-route metadata including change frequency and priority.
Dynamic route generation and assembly
project/src/app/sitemap.ts
Maps roadmap registry keys into roadmap URLs and topic parameters into topic detail URLs, each with appropriate metadata. Combines static and dynamic routes into a single sitemap array return.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A sitemap unfolds like a map for the web,
With static and dynamic routes in step,
From roadmaps and topics, the paths interweave,
Search engines rejoice, their crawlers will cleave! 📍

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding dynamic sitemap generation for roadmaps and static pages, which directly aligns with the changeset.
Linked Issues check ✅ Passed The implementation addresses all coding requirements: sitemap includes main roadmap pages and topic detail pages, uses data-driven generation from roadmapRegistry and getAllRoadmapTopicParams, maintains URL consistency with existing routes, uses Next.js App Router sitemap support, and enables successful builds.
Out of Scope Changes check ✅ Passed All changes are directly scoped to implementing sitemap generation for the project, with no extraneous modifications introduced beyond the stated objectives.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
project/src/app/sitemap.ts (1)

5-5: 💤 Low value

Consider extracting base URL to a shared constant.

The baseUrl construction pattern (reading NEXT_PUBLIC_SITE_URL with the same fallback) is duplicated in roadmapSeo.tsx (line 14). Extracting this to a shared constant or utility function would reduce duplication and ensure consistency.

♻️ Example: Extract to shared config

Create project/src/config/site.ts:

export const siteUrl = process.env.NEXT_PUBLIC_SITE_URL ?? "https://demon-tech-roadmap.vercel.app";

Then import in both files:

-  const baseUrl = process.env.NEXT_PUBLIC_SITE_URL ?? "https://demon-tech-roadmap.vercel.app";
+  import { siteUrl as baseUrl } from "`@/config/site`";
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@project/src/app/sitemap.ts` at line 5, Duplicate base URL construction (const
baseUrl) is used in sitemap.ts and roadmapSeo.tsx; extract it to a single
exported constant (e.g., siteUrl) in a new module (e.g., site config) and update
both sitemap.ts and roadmapSeo.tsx to import that constant instead of recreating
process.env.NEXT_PUBLIC_SITE_URL ?? "https://demon-tech-roadmap.vercel.app";
ensure the exported name matches the import (e.g., export const siteUrl) and
replace existing baseUrl usages with the imported symbol.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@project/src/app/sitemap.ts`:
- Line 5: Duplicate base URL construction (const baseUrl) is used in sitemap.ts
and roadmapSeo.tsx; extract it to a single exported constant (e.g., siteUrl) in
a new module (e.g., site config) and update both sitemap.ts and roadmapSeo.tsx
to import that constant instead of recreating process.env.NEXT_PUBLIC_SITE_URL
?? "https://demon-tech-roadmap.vercel.app"; ensure the exported name matches the
import (e.g., export const siteUrl) and replace existing baseUrl usages with the
imported symbol.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3c5366bc-3a6c-403c-8a95-4a9211a774c1

📥 Commits

Reviewing files that changed from the base of the PR and between cb4c939 and 18e20da.

📒 Files selected for processing (1)
  • project/src/app/sitemap.ts

@RishiByte

Copy link
Copy Markdown
Member

@coolss21 Nice work man

@RishiByte RishiByte merged commit 93aa9d4 into Demon-Die:main Jun 10, 2026
2 of 3 checks passed
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.

Generate sitemap entries for roadmap topic pages

2 participants