-
Notifications
You must be signed in to change notification settings - Fork 532
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
fix(landing): use content-collection again #2685
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@p6l-richard is attempting to deploy a commit to the Unkey Team on Vercel. A member of the Team first needs to authorize it. |
📝 Walkthrough📝 WalkthroughWalkthroughThe changes in this pull request modify the Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Thank you for following the naming conventions for pull request titles! 🙏 |
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
🧹 Outside diff range and nitpick comments (1)
apps/www/app/glossary/sitemap.ts (1)
9-9
: Consider implementing sitemap paginationThe comment about Google's 50,000 URL limit suggests future scalability concerns. While the current implementation is fine, consider adding a TODO to implement pagination if the glossary entries are expected to grow significantly.
Example implementation structure:
async function sitemap(): Promise<MetadataRoute.Sitemap> { const ENTRIES_PER_SITEMAP = 45000; // Buffer below Google's limit const totalEntries = allGlossaries.length; // If below threshold, current implementation is fine if (totalEntries <= ENTRIES_PER_SITEMAP) { return allGlossaries.map(entry => ({ url: `${env().NEXT_PUBLIC_BASE_URL}/glossary/${entry.slug}`, lastModified: entry.updatedAt, })); } // Otherwise, implement sitemap index with multiple sitemaps // See: https://nextjs.org/docs/app/api-reference/functions/generate-sitemaps }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
apps/www/app/glossary/sitemap.ts
(1 hunks)
🔇 Additional comments (2)
apps/www/app/glossary/sitemap.ts (2)
1-6
: LGTM: Imports and configuration are well structured
The configuration with dynamic
and revalidate
flags ensures the sitemap is always fresh, which is crucial for SEO.
10-13
: Verify content collection data integrity
Please ensure:
- The
updatedAt
field from entries matches the required sitemap date format (W3C Datetime format) - The content collection is properly generated and populated
✅ Verification successful
Based on the search results, I can now verify the content collection and data format. The code shows that:
- The
updatedAt
field is properly defined in the content collection schema (apps/www/content-collections.ts
) as a string field. - The field is correctly used in the sitemap generation (
apps/www/app/glossary/sitemap.ts
). - The format appears to be consistent with W3C Datetime format requirements as it's being used directly in the sitemap's
lastModified
field.
No issues found with the sitemap implementation
The content collection appears to be properly configured and the updatedAt
field is being used correctly for sitemap generation.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify content collection structure and data format
# Check content collection structure
ast-grep --pattern 'export const allGlossaries = [
{
$$$
updatedAt: $_,
$$$
}
]'
# Look for content collection generation config
fd -t f 'contentlayer.config' -x cat {}
Length of output: 140
Script:
#!/bin/bash
# Let's try a different approach to verify the content collection and data format
# First, let's find where allGlossaries is defined or imported
rg "allGlossaries" -A 3
# Look for contentlayer config with different possible extensions
fd "contentlayer.config" --extension ts --extension js --extension mjs -x cat {}
# Check for type definitions that might show the expected structure
rg -g "*.d.ts" "Glossary|allGlossaries" -A 5
# Look for content files to verify the actual data structure
fd . --extension mdx --extension md --extension json --type f -x head -n 20 {}
Length of output: 101030
Script:
#!/bin/bash
# Let's verify the content collection and data format in a different way
# Look for content collection type definitions or interfaces
rg -g "*.ts" -g "*.tsx" "type.*Glossary.*=|interface.*Glossary.*{" -A 5
# Check for content files in common content directories
fd -g "*.{md,mdx}" -t f -d 3
# Look for updatedAt field usage in the codebase
rg "updatedAt" -g "*.ts" -g "*.tsx" -A 2
Length of output: 18989
What does this PR do?
sitemap()
fnFixes # (issue)
Type of change
How should this be tested?
/glossary/sitemap.xml
to inspect the XMLChecklist
Required
pnpm build
pnpm fmt
console.logs
git pull origin main
Appreciated
Summary by CodeRabbit
New Features
Bug Fixes