6.1 CMS pages
Most of a site is CMS pages: pages an editor creates in Admin → Pages and builds from blocks. You don't write a route for them. Core's page route serves every one:
| Page slug | URL |
|---|---|
home |
/ |
about |
/about |
tour--houston |
/tour/houston (a section page, §6.4) |
Each page has a title, a description, a status (draft or published; drafts are
never public), its blocks, and SEO settings (title, description, canonical path, robots,
share image, and the AI-answer fields). A page is stored as pages/<slug>.json.
Addresses are lowercase letters, digits and hyphens, with one slash for a page inside a section (§6.4). Nothing else is accepted, so a slug can never point outside the content folder.
6.2 Blocks vs routes
Before writing a route, ask whether it should be a block. A block can be placed, moved and edited by an editor on any page; a route can only be changed in code.
| Make it a block when… | Make it a route when… |
|---|---|
| It is a section of a page | It is a whole page with its own logic (a class finder with filters) |
| Editors should fill it in or move it | Its URL comes from data (/tour/<city>, §6.4) |
| It could appear on more than one page | It needs server-side work a block can't do (reading files, a secret API key) |
6.3 Routes that are not CMS pages
Next.js can't register routes from a module, so a route needs a file under src/app/ in
your repo. Keep that file to one line and put the real component in your feature:
// src/app/class-finder/page.tsx
export { default } from "@/features/encore/pages/ClassFinderPage";
// src/features/encore/pages/ClassFinderPage.tsx
import { getSite } from "@/lib/content";
import { SiteHeader, SiteFooter } from "@/features";
export default function ClassFinderPage() {
const site = getSite();
return (
<>
<SiteHeader site={site} />
<main>{/* … */}</main>
<SiteFooter site={site} />
</>
);
}
SiteHeader and SiteFooter from @/features are your registered header and footer (or
core's), so a code route looks like the rest of the site. Re-export generateMetadata and
generateStaticParams the same way when the page has them:
export { default, generateMetadata, generateStaticParams } from "@/features/encore/pages/TourCityPage";
Rules:
- Don't use a path that is also a CMS page. Your route wins and the CMS page silently stops showing.
- Don't add a file at a path core already has (
ls core/src/app/…first). That includessrc/app/[slug]/[child], core's section pages. Yours replaces core's; see §2.2. - Page components under
src/features/<yours>/pages/may read content on the server (@/lib/content), because only the route imports them. Don't import them from your feature'sindex.ts, which is also loaded in the browser. - Give the page its title, description and canonical URL with
generateMetadata.
6.4 Section pages (/tour/dallas)
A site often needs a group of similar pages under one address: a page per tour city, per program, per location. Section pages are built into core (since 2026-10-21). No route file and no code are needed.
Making one. In Admin → Pages → New page, type the address with a slash:
tour/dallas. The page is served at /tour/dallas. It is an ordinary CMS page in every
other way: blocks, draft and publish, preview, SEO settings, history, THINQ Connect.
Keeping the Pages list tidy. A section's pages fold under one row, "/tour/… 12 pages
in this section", placed right after the Tour page itself. Click it to open the list;
Add page here starts a new page with tour/ already filled in. A search shows every
matching page flat.
A page per city from a template. Build one city page the way you want every city to look, then for each new city:
- Clone it in the Pages list. The copy is a draft at
/tour/dallas-copy, still in the section. - Open it, use Change URL to set
tour/houston, and change its title and details. - Publish.
What core does for them:
| Address | /tour/dallas. The stored name is tour--dallas (a double hyphen, because a page's name is also its file name and can't contain a slash); /tour--dallas redirects permanently to /tour/dallas |
Sitemap, canonical tag, search, llms.txt |
Listed at /tour/dallas |
| Breadcrumbs (structured data) | Home → Tour → Dallas, when a Tour page exists |
| Links in preview | /tour/dallas stays in preview |
| Menus | Link to /tour/dallas like any page; Change URL updates menu links and adds the redirect |
| The section's own page | Optional. /tour is a normal page (often the list of cities) |
Limits:
- One level.
/tour/dallasworks;/tour/texas/dallasdoes not. - Not under core's own routes. A section can't be
blog,events,admin,media,searchor another address core uses (the admin refuses it), because those routes would win. - A site with its own
src/app/[slug]/[child]/page.tsx(some migrated WordPress sites have one) uses that instead of core's. Ask Bo before adding one.
Verified on 2026-10-21 on a local production build, through the admin: New page
tour/dallas, publish, the folded list and Add page here, Clone, Change URL to
tour/houston, the redirect, a blog/x address refused, and the sitemap and
llms.txt entries.
When every city is identical: one list, one template
If the cities differ only in their details (dates, venue, a registration link), the editors may prefer one list to many pages: the Tour page holds a block listing every stop, and a single route renders a page for each. Adding a city is adding an item. This one needs code (a block and a route), and a sitemap entry for each city:
// a block on the /tour page
export const tourStopsBlockSchema = z.object({
type: z.literal("encoreTourStops"),
title: z.string().optional(),
stops: z.array(z.object({
city: z.string().min(1),
slug: z.string().regex(/^[a-z0-9-]+$/, "Lowercase letters, digits and hyphens"),
dates: z.string().optional(),
venue: z.string().optional(),
description: z.string().optional(), // rich text
registerHref: z.string().optional(),
})).describe("One item per city. Slug is the end of the address: dallas → /tour/dallas."),
});
// src/features/encore/pages/TourCityPage.tsx
import type { Metadata } from "next";
import { notFound } from "next/navigation";
import { getPublishedPage, getSite } from "@/lib/content";
import { SiteHeader, SiteFooter } from "@/features";
import { TourCity, type TourStop, type TourStopsBlock } from "../TourStops";
type Params = { params: Promise<{ city: string }> };
export function tourStops(): TourStop[] {
const page = getPublishedPage("tour");
return (page?.blocks ?? [])
.filter((b): b is TourStopsBlock => b.type === "encoreTourStops")
.flatMap((b) => b.stops);
}
export function generateStaticParams() {
return tourStops().map((s) => ({ city: s.slug }));
}
export async function generateMetadata({ params }: Params): Promise<Metadata> {
const { city } = await params;
const stop = tourStops().find((s) => s.slug === city);
if (!stop) return {};
return { title: `${stop.city} — ${getSite().name}`, alternates: { canonical: `/tour/${stop.slug}` } };
}
export default async function TourCityPage({ params }: Params) {
const { city } = await params;
const stop = tourStops().find((s) => s.slug === city);
if (!stop) notFound();
const site = getSite();
return (<><SiteHeader site={site} /><main><TourCity stop={stop} /></main><SiteFooter site={site} /></>);
}
// src/app/tour/[city]/page.tsx
export { default, generateMetadata, generateStaticParams } from "@/features/encore/pages/TourCityPage";
// src/site/sitemap.ts: your copy replaces core's empty one (§6.8)
import type { SitemapEntry } from "@/framework/feature-module";
import { tourStops } from "@/features/encore/pages/TourCityPage";
export function siteSitemapEntries(baseUrl: string): SitemapEntry[] {
return tourStops().map((s) => ({ url: `${baseUrl}/tour/${s.slug}`, changeFrequency: "monthly" }));
}
src/app/tour/[city] is a static tour segment, so it takes over /tour/<anything> from
core's section pages for this site: use one approach per section, not both. The block,
route, template and sitemap hook were verified on 2026-10-21 in a production build of the
Encore site: the hook's city pages were listed in the sitemap beside the CMS pages.
| Section pages | One list + template | |
|---|---|---|
| Code needed | None | A block, a route, a sitemap hook |
| Each city laid out differently | Yes | No, one layout |
| Adding a city | Clone, Change URL, edit | Add an item |
| Pages list | Folded under /tour/… | Just the Tour page |
6.5 Images and files: where they go
| What | Where | Referenced as |
|---|---|---|
| Logos, icons, brand artwork your code uses | Your repo's public/ (e.g. public/brand/encore-logo.svg) |
/brand/encore-logo.svg |
| Photos editors manage on pages | Admin → Media on the staging or live site, picked in a block's image field | /media/<name> (stored by the field) |
| Downloads (PDF schedules) that change | Admin → Media | /media/<name> |
| Downloads that are part of the design | public/ |
/<path> |
Files in public/ deploy with the code and are the same everywhere. Media uploaded
through the admin lives on the site's volume, so an image uploaded on your local admin is
not on staging; upload real content on staging. Show every image with SiteImage
(Blocks §4.6); it
resizes uploaded images for small screens automatically.
6.6 Seed content vs live content
Your repo's content/ folder is the site's seed: what a brand-new deployment starts
with (pages, menus, site.json settings, theme.json, forms). After the first boot the
site's real content lives on the host's volume, and:
- A new file in
content/(a new page) is added to the volume on the next deploy. - A changed file in
content/updates the volume copy only if nobody has edited that file on the site since it was seeded. Once an editor saves a page (or the settings) in the admin, the repo's copy of that file never overwrites it again. - A file deleted on the site stays deleted.
So content/ is right for starting content and for pages nobody has touched, and wrong
for changing a live site. To change content on staging or live, use its admin, or ask Bo.
In particular, site.json on staging has almost certainly been edited, so settings you
add to the repo's site.json (a logo, social links) won't appear there on their own.
6.7 Smooth scrolling
The public site scrolls with Lenis, a smooth-scrolling library, and how much is the site's own choice: Settings → Smooth scrolling (since 2026-10-21).
| Setting | Feel |
|---|---|
| Soft (default) | A long, gliding scroll. Lenis moves 9% of the way to the target each frame (lerp: 0.09), the feel every site had before the setting existed |
| Medium | lerp: 0.15 |
| Light | lerp: 0.25, barely smoothed |
| Off | The browser's own scrolling |
Visitors whose device asks for reduced motion always get the browser's own scrolling.
The admin never has smooth scrolling. #anchor links scroll smoothly too, and land
scroll-margin-top clear of a sticky header (Blocks §4.8).
For a new site, set the default in content/site.json ("smoothScroll": "light"); on
staging or live, it is the admin setting. The setting is read by core's SmoothScroll
component, so it works with a site's own layout.tsx too, as long as the layout still
wraps the page in <SmoothScroll>.
Verified on 2026-10-21 on a local production build: saving Off in Settings removed Lenis from the public page, and Light brought it back.
6.8 Site hooks
A few files under src/site/ are site hooks: core ships a default that does nothing,
and a site that needs something puts its own copy at the same path, which replaces core's
when the site is assembled. They are deliberately not on the drift list, so your copy is
never reported as drift.
| Hook | What it is for |
|---|---|
src/site/sitemap.ts |
siteSitemapEntries(baseUrl): sitemap URLs for pages your own routes serve. CMS pages, section pages and blog posts are listed already. Everything returned is also sent to search engines through IndexNow |
If you need a hook that doesn't exist, ask Bo; it is usually a small core change.
This text is maintained in thinq-site-core at docs/developers/06-pages-routes-and-content.md (commit e72488e) and published here unchanged.