-
Notifications
You must be signed in to change notification settings - Fork 432
Update sitemap.ts to reflect current website structure #2053
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add new static routes: /brand, /company-handbook, /file-transcription, /free, /gallery, /oss-friends, /press-kit, /download/apple-intel - Add dynamic route handlers for: /templates/$slug, /shortcuts/$slug, /roadmap/$slug, /vs/$slug, /company-handbook/$, /gallery/$type/$slug - Remove /contact route (moved to root level, not part of _view layout) Co-Authored-By: john@hyprnote.com <john@hyprnote.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
✅ Deploy Preview for hyprnote ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for hyprnote-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughExtended sitemap generation to include numerous new static routes ( Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–30 minutes
Possibly related PRs
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
apps/web/src/utils/sitemap.ts (2)
286-305: Consider addinglastModifiedfor SEO consistency.The handlers for
/templates/$slug,/shortcuts/$slug,/vs/$slug, and/gallery/$type/$slugomit thelastModifiedfield, while other handlers (blog, changelog, roadmap, company-handbook) include it. If these content types haveupdatedorcreatedfields, addinglastModifiedimproves search engine indexing.Example for
/templates/$slug:return allTemplates.map((template: any) => ({ path: `/templates/${template.slug}`, priority: 0.7, changeFrequency: "weekly" as const, + lastModified: template.updated || template.created, }));Also applies to: 307-326, 350-369, 393-428
286-428: Extract common module resolution logic into a helper.Every dynamic handler repeats the same boilerplate for resolving
.content-collectionsmodule paths. Consider extracting this to reduce duplication and simplify future additions.async function loadContentCollection<T>(fileName: string): Promise<T[]> { const path = await import("path"); const url = await import("url"); const __dirname = path.dirname(url.fileURLToPath(import.meta.url)); const modulePath = path.resolve( __dirname, `../../.content-collections/generated/${fileName}`, ); const { default: items } = await import(modulePath); return items; } // Usage: "/templates/$slug": async () => { try { const allTemplates = await loadContentCollection<any>("allTemplates.js"); return allTemplates.map((template) => ({ path: `/templates/${template.slug}`, priority: 0.7, changeFrequency: "weekly" as const, })); } catch (error) { console.warn("Failed to load templates for sitemap:", error); return []; } },
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/web/src/utils/sitemap.ts(3 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.ts
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.ts: Agent implementations should use TypeScript and follow the established architectural patterns defined in the agent framework
Agent communication should use defined message protocols and interfaces
Files:
apps/web/src/utils/sitemap.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}: Avoid creating a bunch of types/interfaces if they are not shared. Especially for function props, just inline them instead.
Never do manual state management for form/mutation. Use useForm (from tanstack-form) and useQuery/useMutation (from tanstack-query) instead for 99% of cases. Avoid patterns like setError.
If there are many classNames with conditional logic, usecn(import from@hypr/utils). It is similar toclsx. Always pass an array and split by logical grouping.
Usemotion/reactinstead offramer-motion.
Files:
apps/web/src/utils/sitemap.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: Redirect rules - hyprnote
- GitHub Check: Header rules - hyprnote
- GitHub Check: Pages changed - hyprnote
- GitHub Check: Devin
- GitHub Check: fmt
- GitHub Check: ci
🔇 Additional comments (3)
apps/web/src/utils/sitemap.ts (3)
129-160: LGTM!The new static routes (
/brand,/company-handbook,/file-transcription,/free,/gallery,/oss-friends,/press-kit) are configured with appropriate priorities and change frequencies that align with the existing patterns in the file.
182-189: LGTM!Adding
/download/apple-intelalongside/download/apple-siliconfor complete coverage of download options.
393-428: LGTM on aggregating gallery items from templates and shortcuts.The approach of combining both content types into a single handler for the
/gallery/$type/$slugroute is logical and correctly produces distinct paths for/gallery/template/{slug}and/gallery/shortcut/{slug}.
Update sitemap.ts to reflect current website structure
Summary
Updates the sitemap configuration to include new routes that have been added to the website and adds dynamic route handlers for content collections that were missing.
New static routes added:
/brand,/company-handbook,/file-transcription,/free,/gallery,/oss-friends,/press-kit,/download/apple-intelNew dynamic route handlers added:
/templates/$slug- generates URLs from allTemplates collection/shortcuts/$slug- generates URLs from allShortcuts collection/roadmap/$slug- generates URLs from allRoadmaps collection/vs/$slug- generates URLs from allVs collection/company-handbook/$- generates URLs from allHandbooks collection/gallery/$type/$slug- generates URLs for gallery items (templates + shortcuts)Removed:
/contactroute (moved to root level, outside_viewlayout)Review & Testing Checklist for Human
allRoadmaps.js,allVs.js,allHandbooks.js,allShortcuts.js- confirm these are the correct generated file names in.content-collections/generated/Notes