Skip to content

Conversation

@exacs
Copy link
Contributor

@exacs exacs commented Dec 3, 2025

This PR implements generateStaticParams for the nextjs-template

Copilot finished reviewing on behalf of exacs December 3, 2025 15:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds static site generation (SSG) support to the Next.js template by implementing the generateStaticParams function. This function queries all pages from Optimizely CMS at build time and generates static routes for them, improving performance by pre-rendering pages. The implementation includes adding a new APPLICATION_HOST environment variable to filter pages belonging to the current application.

Key Changes

  • Implements generateStaticParams to fetch and generate static routes for up to 100 pages from Optimizely CMS
  • Adds dynamicParams = true configuration to allow non-pre-rendered routes to be handled at runtime
  • Introduces APPLICATION_HOST environment variable for filtering pages by host

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.

File Description
samples/nextjs-template/src/app/[...slug]/page.tsx Adds generateStaticParams function with GraphQL query to fetch all pages, transform their paths, and return properly formatted route parameters for Next.js static generation
samples/nextjs-template/.env.in Adds APPLICATION_HOST environment variable configuration entry

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@TRomesh TRomesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

4 participants