{"id":24755187,"url":"https://github.com/gravity-ui/page-constructor-website-template","last_synced_at":"2025-10-11T01:31:29.384Z","repository":{"id":104912646,"uuid":"567164723","full_name":"gravity-ui/page-constructor-website-template","owner":"gravity-ui","description":"Template for multi-page SSR website with dynamic content","archived":false,"fork":false,"pushed_at":"2024-01-26T12:59:54.000Z","size":764,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-01-26T19:37:13.618Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gravity-ui.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-11-17T07:55:22.000Z","updated_at":"2023-08-17T16:24:09.000Z","dependencies_parsed_at":"2023-11-09T17:25:27.538Z","dependency_job_id":"2d78b5df-eb81-4b1a-a651-327ddc139747","html_url":"https://github.com/gravity-ui/page-constructor-website-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gravity-ui%2Fpage-constructor-website-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gravity-ui%2Fpage-constructor-website-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gravity-ui%2Fpage-constructor-website-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gravity-ui%2Fpage-constructor-website-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gravity-ui","download_url":"https://codeload.github.com/gravity-ui/page-constructor-website-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236017991,"owners_count":19082017,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-28T12:36:55.286Z","updated_at":"2025-10-11T01:31:28.855Z","avatar_url":"https://github.com/gravity-ui.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Next.js + page-constructor template\n\nTemplate for multi-page SSR website with dynamic content\n\nLinks:\n\n[Next.js](https://nextjs.org/)\n\n[page-constructor](https://github.com/gravity-ui/page-constructor)\n\n## Create project from template\n\n```bash\nnpx create-next-app@latest \u003cmy-app\u003e --example https://github.com/gravity-ui/page-constructor-website-template\n\ncd my-app\n\nrm -rf .git\n```\n\n## Build modes\n\nTemplate supports two build modes:\n\n1. [Server side rendering (SSR)](https://nextjs.org/docs/pages/building-your-application/rendering/server-side-rendering)\n\nThis mode is set by default.\n\n### Development\n\n```bash\nnpm ci\n\nnpm run dev\n```\n\n### Production\n\n```bash\nnpm ci\n\nnpm run build\n\nnpm run start\n```\n\n2. [Static site generation (SSG)](https://nextjs.org/docs/pages/building-your-application/rendering/static-site-generation)\n\nSSG mode supports now only one locale, to set it use `EXPORT_LOCALE` env variable.\n\n### Development\n\n```bash\nnpm ci\n\nnpm run dev:export\n```\n\n### Production\n\n```bash\nnpm ci\n\n# generate static production build and puts it to `out` folder.\nnpm run build:export\n\n# run this locally to check everyting works in production mode\nnpm run start:export\n```\n\n## Environment variables\n\nYou can define environment variables for dev-mode in `.env.local` file within project root.\n\n`ALLOW_ROBOTS` - allow search engine robots to index your app;\n\n`APP_ENV` - environment `prod`, `preprod` or `dev`;\n\n`DISABLE_LOGGING` (optional) - turn logging off;\n\n`LOGGING_LEVEL` (optional) - set logging level (default `debug`). [More about logging level](https://getpino.io/#/docs/api?id=level-string);\n\n`PAGES_CACHE_TIME` (optional) - page data cache living time in production;\n\n`NAVIGATION_CACHE_TIME` (optional) - navigation data cache living time in production;\n\n`EXPORT_MODE` (optional) - boolean, sets export mode on\n\n`EXPORT_LOCALE`(optional) - sets locale for export mode\n\n`DEV_MODE` - enables dev mode;\n\n`SITE_URL` - site url, it will be used for creating sitemap\n\n## Content\n\nBy default website template keeps it's content inside `content` folder in `.yaml` files, splitted by locales, e.g `content/en`, `content/fr`\n\nThere are two types of content files:\n\n- `pages` - each file in the directory represents website page. Page url is defined by file name and path (`pages` folder equals to the site root). Page file data format is compatible with page-constructor [content](https://github.com/gravity-ui/page-constructor?tab=readme-ov-file#parameters)\n\n- `data` files keep whole site related data (navigation, meta, analytics configuration, etc). Navigtion file format is compatible with page-constructor [navigation](https://github.com/gravity-ui/page-constructor?tab=readme-ov-file#parameters)\n\n### Custom api\n\nTo use custom api for getting page data implement method returning value of type `ContentResponseType` in `src/server/api/pages-data/implementations/` folder and export it from `src/server/api/pages-data/impl.js`.\n\n```typescript\ninterface ContentResponseType {\n  statusCode: 200 | 404 | 500;\n  error?: string;\n  data?: ConstructorPageContent;\n}\n```\n\n## Sitemap and Robots.txt\n\n### Default mode\n\n1. Set the SITE_URL for sitemap\n2. You can find sitemap in src/pages/server-sitemap.xml\n\n### For SSG mode (EXPORT_MODE)\n\n1. Set the SITE_URL for sitemap\n2. Every build we use next-sitemap to auto-generate sitemap and robots\n\n### If sitemap is not necessary\n\n1. For SSG mode (EXPORT_MODE) - fix command `build:export` in package.json and remove src/pages/server-sitemap.xml\n2. For Default mode - remove src/pages/server-sitemap.xml\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgravity-ui%2Fpage-constructor-website-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgravity-ui%2Fpage-constructor-website-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgravity-ui%2Fpage-constructor-website-template/lists"}