Skip to content

Comments

Create dynamic sitemap with static and agent routes#249

Merged
CharlyMartin merged 3 commits intomainfrom
mm/create-sitemap
Feb 19, 2026
Merged

Create dynamic sitemap with static and agent routes#249
CharlyMartin merged 3 commits intomainfrom
mm/create-sitemap

Conversation

@mirhamasala
Copy link
Collaborator

@mirhamasala mirhamasala commented Feb 18, 2026

📝 Description

This PR implements a dynamic sitemap that includes both static routes and dynamically generated agent routes. This improves SEO by ensuring all pages are discoverable by search engines.

  • Type: New feature

NOTE: Will add a lastUpdated field to the /agents[slug] pages in a separate PR.

Fixes: #248

🛠️ Key Changes

  • Converted sitemap from static to async function to fetch agent data
  • Added static routes from PATHS constants with appropriate priority levels
  • Added dynamic agent routes by fetching all RFS data and generating URLs for each agent
  • Set home page priority to 1, static pages to 0.8, and agent pages to 0.7
  • Updated Badge component to disable text transformation for proper styling
  • Bumped @filecoin-foundation/ui-filecoin dependency to 0.8.0

📌 To-Do Before Merging

  • Verify sitemap generates correctly at /sitemap.xml
  • Check that all expected routes appear in the sitemap
  • Confirm sitemap format is valid for search engines

🧪 How to Test

  • Setup: Run the development server
  • Steps to Test:
    1. Navigate to http://localhost:3000/sitemap.xml
    2. Verify all static routes (home, agents, etc.) are present
    3. Verify all agent routes are listed with correct slugs
    4. Check that priorities are set correctly (home=1, static=0.8, agents=0.7)
  • Expected Results: A valid XML sitemap displaying all routes with appropriate metadata
  • Additional Notes: The sitemap will update automatically as new agents are added

📸 Screenshots

CleanShot 2026-02-18 at 08 54 34@2x

🔖 Resources

@vercel
Copy link

vercel bot commented Feb 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
filecoin-cloud Ready Ready Preview, Comment Feb 18, 2026 9:30am

Request Review

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances SEO by converting the static sitemap to a dynamic one that includes both static routes and agent-specific routes generated from markdown files.

Changes:

  • Made sitemap function async to support dynamic data fetching
  • Added static routes from PATHS constants with priority-based ranking (home=1, static=0.8)
  • Added dynamic agent routes by fetching RFS data and generating URLs with priority 0.7

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 7 to 11
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
const staticRoutes = getStaticRoutes();
const agentRoutes = await getAgentRoutes();

return [...staticRoutes, ...agentRoutes];
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

The sitemap function doesn't include error handling for the async getAllRFSData() call. If this function fails (e.g., due to file system errors or invalid markdown), the entire sitemap generation will fail, potentially breaking the site's /sitemap.xml endpoint. Consider adding a try-catch block to handle errors gracefully, either by logging and returning only static routes, or by ensuring getAllRFSData has its own error handling. The pattern in src/app/agents/[slug]/page.tsx (lines 20-86) shows similar async data fetching with try-catch error handling.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

getAllRFSData reads local markdown files that are committed to the repo. Any failures (missing files, invalid frontmatter) would surface at build time when Next.js pre-renders the agent pages, well before the sitemap is generated. So a try-catch here wouldn't add meaningful resilience in practice.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-project-automation github-project-automation bot moved this from 📌 Triage to ✔️ Approved by reviewer in FOC Feb 19, 2026
@CharlyMartin CharlyMartin merged commit 4165d5e into main Feb 19, 2026
12 checks passed
@CharlyMartin CharlyMartin deleted the mm/create-sitemap branch February 19, 2026 12:34
@github-project-automation github-project-automation bot moved this from ✔️ Approved by reviewer to 🎉 Done in FOC Feb 19, 2026
@github-actions github-actions bot removed the size/S label Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

Create sitemap for the website

2 participants