Skip to content

docs(next): add Pages Router quickstart#350

Merged
ErnestM1234 merged 2 commits into
mainfrom
e/next-pages-quickstart
Jul 13, 2026
Merged

docs(next): add Pages Router quickstart#350
ErnestM1234 merged 2 commits into
mainfrom
e/next-pages-quickstart

Conversation

@ErnestM1234

Copy link
Copy Markdown
Contributor

Summary

Adds a Pages Router quickstart for gt-next v11 alongside the existing App Router quickstart (this was an open follow-up from the Odysseus docs work — the Pages Router helpers were previously undocumented):

  • next/tutorials/quickstart-pages-router — full setup guide: withGTConfig, gt.config.json, auto-detected loadTranslations.ts, wrapping getServerSideProps with withGTServerSideProps (resolves the locale from the generaltranslation.locale cookie, falling back to Accept-Language, and snapshots translations per request), and wiring <GTProvider locale translations> in _app.tsx typed with WithGTServerSideProps.
  • Covers the no-argument form withGTServerSideProps() for pages without their own server-side props, redirect/notFound passthrough, and why there's no getStaticProps equivalent.
  • Added to the sidebar under Tutorials and cross-linked from the App Router quickstart with a callout.

Content is cross-checked against the next-pages-router app in gt-test-apps and the v11 gt-next sources (withGTServerSideProps injects locale, translations, and an internal enableI18n flag; the type is WithGTServerSideProps<Props>; both export from the gt-next root).

Validation

  • npx tsx scripts/validate-links.ts passes
  • pnpm build:content passes; the new page appears in the prerender manifest

Note: the one-callout edit to next/index.mdx may need a trivial rebase if #340 (which rewrites that page) merges first.

- New tutorials/quickstart-pages-router page: withGTServerSideProps around
  getServerSideProps, GTProvider wiring in _app.tsx via WithGTServerSideProps,
  local translation loading, LocaleSelector, env vars, and deployment
- Link to it from the App Router quickstart and add it to the sidebar
@ErnestM1234
ErnestM1234 requested a review from a team as a code owner July 9, 2026 23:00
@ErnestM1234
ErnestM1234 enabled auto-merge (squash) July 10, 2026 04:47
@ErnestM1234
ErnestM1234 merged commit 138d408 into main Jul 13, 2026
7 checks passed
@ErnestM1234
ErnestM1234 deleted the e/next-pages-quickstart branch July 13, 2026 23:30
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.

2 participants