Skip to content

fix(landing): graceful not-found handling for blog and library posts and authors#5661

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/content-not-found
Jul 14, 2026
Merged

fix(landing): graceful not-found handling for blog and library posts and authors#5661
waleedlatif1 merged 1 commit into
stagingfrom
fix/content-not-found

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • /blog/[slug] and /library/[slug] with an unknown slug now render section-scoped "Post not found" pages with a Browse CTA — the exact pattern integrations/models/comparisons already use (notFound() guard + section-local not-found.tsx) — instead of falling through to the bare root "Page not found"
  • getPostBySlug returns null for unknown slugs instead of throwing, removing a latent 500 (the throw was only masked by dynamicParams = false); both pages and generateMetadata now guard
  • /blog/authors/[id] and /library/authors/[id] with an unknown author now return a real 404 via notFound() + author-scoped not-found.tsx — previously they returned an indexable HTTP 200 soft-404
  • Removed ContentAuthorPage's now-dead inline "Author not found" fallback and made authorName required — both consumers guard before rendering

Type of Change

  • Bug fix

Testing

Verified on a dev server: unknown post slugs 404, unknown authors render the author not-found screen, and real posts/authors are unaffected. Dev enforces dynamicParams = false as a root-level 404 (confirmed identical dev behavior for the existing integrations/models routes, which render their section not-found in production per staging), so production behavior matches the established sections. Typecheck and lint pass; all getPostBySlug call sites audited for null-safety.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jul 14, 2026 1:30am

Request Review

@cursor

cursor Bot commented Jul 14, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Landing-only routing and SEO behavior changes with no auth or data handling; pattern matches other landing sections.

Overview
Blog and library post and author routes now return proper 404s with section-specific UI instead of errors or soft 200s.

getPostBySlug returns null for unknown slugs (no throw), and blog/library slug pages call notFound() when missing; generateMetadata returns empty metadata in that case. New not-found.tsx files under /blog, /blog/authors, /library, and /library/authors show “Post/Author not found” with browse CTAs and robots: noindex.

Author routes notFound() when the id has no author (fixing indexable soft-404s). ContentAuthorPage drops its inline not-found branch; authorName is required and callers guard before render.

Reviewed by Cursor Bugbot for commit 3c29e20. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds scoped not-found handling for landing content pages. The main changes are:

  • Missing blog and library posts now return section-level not-found pages.
  • Unknown blog and library authors now call notFound() instead of rendering an inline fallback.
  • getPostBySlug now returns null for unknown slugs.
  • ContentAuthorPage now requires a resolved author name.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
apps/sim/lib/content/registry-factory.ts getPostBySlug now returns null instead of throwing when a slug is missing.
apps/sim/app/(landing)/blog/[slug]/page.tsx The blog post page now guards missing posts in metadata and render paths.
apps/sim/app/(landing)/library/[slug]/page.tsx The library post page now guards missing posts in metadata and render paths.
apps/sim/app/(landing)/blog/authors/[id]/page.tsx The blog author page now returns not-found when the author cannot be resolved.
apps/sim/app/(landing)/library/authors/[id]/page.tsx The library author page now returns not-found when the author cannot be resolved.
apps/sim/app/(landing)/components/content-author-page/content-author-page.tsx The shared author page component no longer renders its own missing-author fallback.
apps/sim/app/(landing)/blog/not-found.tsx Adds a blog-scoped post not-found page.
apps/sim/app/(landing)/library/not-found.tsx Adds a library-scoped post not-found page.
apps/sim/app/(landing)/blog/authors/not-found.tsx Adds a blog author not-found page.
apps/sim/app/(landing)/library/authors/not-found.tsx Adds a library author not-found page.

Reviews (1): Last reviewed commit: "fix(landing): graceful not-found handlin..." | Re-trigger Greptile

@waleedlatif1 waleedlatif1 merged commit 3d6c159 into staging Jul 14, 2026
18 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/content-not-found branch July 14, 2026 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant