Skip to main content

Overview

This guide uses:
  • Next.js 16 (App Router)
  • Server Components
  • Static list generation with revalidation
  • Dynamic blog/[slug] pages

1. Create environment variables

2. Add a CMS fetch helper

Create src/lib/skayle-cms.ts:

3. Build static blog listing

Create src/app/blog/page.tsx:

4. Build dynamic blog/[slug] page

Create src/app/blog/[slug]/page.tsx:

5. Production-ready patterns

  • Keep fetches server-side in App Router for stable SEO output.
  • Use revalidate for incremental freshness.
  • Use notFound() for missing slugs.
  • Add a local error boundary (error.tsx) and loading states (loading.tsx) for resilience.
  • If you need immediate freshness for preview-like behavior, use cache: "no-store" selectively.

6. Use non-article collections (optional)

If your organization uses additional collections/content types, fetch from collection items. Non-article collections are available on the Authority plan.
/posts is still supported as an alias, but /articles is the primary endpoint.