Enhancement: Add dynamic sitemap generation for roadmaps and static pages (#101)#140
Enhancement: Add dynamic sitemap generation for roadmaps and static pages (#101)#140coolss21 wants to merge 1 commit into
Conversation
|
@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. |
📝 WalkthroughWalkthroughThis 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. ChangesSitemap Generation for Roadmap Content
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
project/src/app/sitemap.ts (1)
5-5: 💤 Low valueConsider extracting base URL to a shared constant.
The
baseUrlconstruction pattern (readingNEXT_PUBLIC_SITE_URLwith the same fallback) is duplicated inroadmapSeo.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
📒 Files selected for processing (1)
project/src/app/sitemap.ts
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
project/src/app/sitemap.ts.roadmapRegistryroutes andtopicIdroutes.Summary by CodeRabbit
Release Notes