# General Translation React SDKs (gt-react, gt-next): Pages Router static site generation URL: https://generaltranslation.com/en-GB/docs/react/nextjs/pages-router-static-site-generation.mdx --- title: Pages Router static site generation description: How to pre-render localised Next.js Pages Router pages with General Translation. related: links: - /docs/react/nextjs-pages-router-quickstart - /docs/react/nextjs/pages-router-middleware - /docs/react/guides/storing-translations --- Pre-render localised Pages Router pages with `withGTStaticProps`. The setup mirrors `withGTServerSideProps`, but Next.js generates the props at build time. ## Keep your Next.js config [#config] Static generation does not change your `withGTConfig` setup: ```ts title="next.config.ts" import type { NextConfig } from 'next'; import { withGTConfig } from 'gt-next/config'; const nextConfig: NextConfig = {}; export default withGTConfig(nextConfig); ``` ## Configure locale routing [#routing] Follow the [Pages Router middleware guide](/docs/react/nextjs/pages-router-middleware) to create `proxy.ts` and move your routes under `pages/[locale]`. ## Add static props [#static-props] Wrap each page's `getStaticProps` function with `withGTStaticProps`: ```tsx title="pages/[locale]/about.tsx" import type { GetStaticProps } from 'next'; import { T, Var, withGTStaticProps } from 'gt-next'; type AboutPageProps = { generatedAt: string; }; export const getStaticProps: GetStaticProps = withGTStaticProps(async () => ({ props: { generatedAt: new Date().toISOString(), }, })); export default function AboutPage({ generatedAt }: AboutPageProps) { return Generated at: {generatedAt}; } ``` `withGTStaticProps` adds the locale and translation snapshot to the returned page props. If the page has no other props, use the no-argument form: ```tsx title="pages/[locale]/index.tsx" import { withGTStaticProps } from 'gt-next'; export const getStaticProps = withGTStaticProps(); ``` Pass those values to `GTProvider` and [connect locale changes](/docs/react/nextjs/pages-router-middleware#locale-changes) in `_app.tsx`. ## Next steps - /docs/react/nextjs-pages-router-quickstart - /docs/react/nextjs/pages-router-middleware - /docs/react/guides/storing-translations