-
Notifications
You must be signed in to change notification settings - Fork 2.8k
MKT-71: Update sitemap generation to include blog and blog posts #11023
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
base: main
Are you sure you want to change the base?
Conversation
- Add gray-matter for frontmatter parsing - Create BlogPost type and zod schema for validation - Implement PT timezone helpers (getNowPt, parsePublishTimePt) - Implement content loading (getAllBlogPosts, getBlogPostBySlug) - Implement isPublished for request-time publish gating - Add validation for frontmatter and duplicate slugs - Create content/blog directory for markdown files Closes: MKT-67
…he Past Adds the first canonical blog post to validate the content pipeline: - Title: PRDs Are Becoming Artifacts of the Past - Slug: prds-are-becoming-artifacts-of-the-past - Status: published - Publish date: 2026-01-12 at 9:00am PT Content sourced from Office Hours S01E15 with Paige Bailey. Closes: MKT-73
- Create blog index page at /blog - Use force-dynamic for request-time publish gating - Require Node.js runtime for filesystem reads - Display posts with title, description, and date - Add empty state when no posts are published - Include tags display (up to 3) Closes: MKT-68
- Create dynamic route for individual blog posts - Use force-dynamic for request-time publish gating - Require Node.js runtime for filesystem reads - Return 404 for drafts, future posts, or invalid slugs - Render Markdown with react-markdown + remark-gfm - No raw HTML rendering (safe by default) - Include consistent typography and styling Closes: MKT-69
- Add structured-data.ts with Article, CollectionPage, and BreadcrumbList schemas - Integrate JSON-LD into /blog index page (Blog collection + breadcrumbs) - Integrate JSON-LD into /blog/[slug] page (Article + post breadcrumbs) - Export structured data utilities from blog module index MKT-70
- Add analytics.ts with blog-specific tracking events: - trackBlogIndexView: Track blog index views with post count - trackBlogPostView: Track individual post views with metadata - trackBlogPostScrollDepth: Track reading progress (25%, 50%, 75%, 100%) - trackBlogPostTimeSpent: Track time spent on posts - trackBlogPostShare: Track social share clicks - trackBlogPostCTAClick: Track CTA engagement - Add BlogIndexAnalytics and BlogPostAnalytics client components - Integrate analytics into /blog and /blog/[slug] pages Attribution is handled by PostHog save_referrer and save_campaign_params. MKT-74
- Add SUBSTACK link to constants.ts - Add Blog link to desktop nav Resources dropdown - Add Blog link to mobile nav Resources section - Add Blog link to footer Resources section - Add Substack link to footer Connect section MKT-72
- Create sitemap.ts with MetadataRoute.Sitemap for Next.js - Include all static pages with priorities and change frequencies - Include /blog index page (priority 0.8, daily updates) - Dynamically include all published blog post URLs (/blog/[slug]) - Blog posts use publish_date as lastModified The sitemap is referenced by robots.ts at /sitemap.xml MKT-71
All issues have been resolved. The latest commit fixes build issues by avoiding barrel imports in client components.
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>
|
@roomote look into failing tests Preview roocode.com / preview (pull_request) |
Fixed the build failure. The client component was importing from the barrel export which pulled in Node.js |
The blog-analytics.tsx client component was importing from the @/lib/blog barrel export, which transitively included content.ts that uses the Node.js fs module. This caused the build to fail with "Module not found: Cannot resolve fs" error. Changed imports to use direct file paths: - Import BlogPost type from @/lib/blog/types - Import analytics functions from @/lib/blog/analytics This avoids pulling content.ts into the client bundle.
|
🚀 Preview deployed! Your changes have been deployed to Vercel: Preview URL: https://roo-code-website-k8ql2dloc-roo-code.vercel.app This preview will be updated automatically when you push new commits to this PR. |
This PR creates a comprehensive sitemap.ts file that includes all static pages and dynamically generated blog post URLs.
Changes
New File:
src/app/sitemap.tsCreates a Next.js sitemap using the MetadataRoute.Sitemap API that:
Static Pages (with priorities):
Dynamic Blog Post Pages:
How It Works
The sitemap is automatically generated at /sitemap.xml by Next.js. It uses the getAllBlogPosts function to dynamically include all published blog posts, which means new posts will be automatically included in the sitemap when published.
Reference
The sitemap is already referenced in robots.ts:
sitemap: `${SEO.url}/sitemap.xml`Testing
pnpm lint)pnpm check-types)Closes MKT-71
Important
Adds comprehensive sitemap generation and blog content management with dynamic blog post URLs, analytics, and SEO enhancements.
sitemap.tsinsrc/appgenerates sitemap with static pages and dynamic blog post URLs.getAllBlogPosts()with monthly change frequency.content.tsfor loading and parsing markdown blog posts.getAllBlogPosts()andgetBlogPostBySlug()for fetching blog data.zodschema intypes.ts.page.tsxfor individual blog posts andpage.tsxfor blog index insrc/app/blog.ReactMarkdownwithremarkGfmfor rendering markdown content.blog-analytics.tsxtracks page views, scroll depth, and time spent using PostHog.structured-data.tsgenerates JSON-LD for articles and collections.footer.tsxandnav-bar.tsxcomponents.package.jsonto includegray-matterfor markdown parsing.This description was created by
for 63d8d63. You can customize this summary. It will automatically update as commits are pushed.