Pages and sections — KorDent Next.js
A page is a small file that picks sections and hands them content. src/app/blog/page.tsx is the whole Blog page:
export const metadata: Metadata = pageMeta(routes.blog, { title: blogPage.meta.title, description: blogPage.meta.description });
export default async function BlogPage() { const posts = await getPosts(); return ( <> <BlogListSection copy={blogPage} posts={posts.map(toPostCard)} /> <CtaSection cta={cta} /> </> );}pageMeta(route, meta)gives the page its browser title, description, canonical link and share image.getPosts()reads the collection (see Editing the content).toPostCardturns each post into what a card shows (src/lib/to-ui.ts).- The sections render them: the title block and every post as a card, then the closing call to action.
The pages
Section titled “The pages”10 kinds of page and 29 addresses in the demo. Every address is in src/content/routes.ts; note that Services lives at
/service, in the singular, so a service is /service/general-dentistry.
| Page | Address | Page file | Copy (src/content/pages/) |
Items it shows |
|---|---|---|---|---|
| Home | / |
src/app/page.tsx |
home.ts |
services, departments, facts, outcomes, dentists, reviews, posts |
| About | /about |
src/app/about/page.tsx |
about.ts |
facts, features, dentists |
| Services | /service |
src/app/service/page.tsx |
services.ts |
services, departments, advantages, dentists, features, reviews |
| Service | /service/<slug> |
src/app/service/[slug]/page.tsx |
service.ts |
one service, its dentists, six other services |
| Blog | /blog |
src/app/blog/page.tsx |
blog.ts |
posts |
| Post | /blog/<slug> |
src/app/blog/[slug]/page.tsx |
post.ts |
one post, three others |
| Contact | /contact |
src/app/contact/page.tsx |
contact.ts |
— |
| Book | /book |
src/app/book/page.tsx |
book.ts |
services, dentists, advantages, features |
| Legal page | /legal/<slug> |
src/app/legal/[slug]/page.tsx |
legal.ts |
one legal page |
| 404 | any unknown address | src/app/not-found.tsx |
not-found.ts |
— |
To change an address, rename its folder in src/app/ and its entry in routes.ts, and search the content for the old
address: links written as text aren’t checked (removing a page).
The sections you can use
Section titled “The sections you can use”In src/components/sections/, one folder per page and the shared ones at the top. Each takes its copy from a page file
(or site.ts) and its items from a collection.
| Section | File | Used on |
|---|---|---|
HeroSection, AboutSection, OutcomesSection, BlogSection |
home/ |
Home |
ServicesSection (the services grid with filter and search) |
home/ServicesSection.tsx |
Home, Services, Service |
DoctorsSection (the dentist tabs) |
home/DoctorsSection.tsx |
Home, About |
TestimonialsSection (the review form and cards) |
home/TestimonialsSection.tsx |
Home, Services |
AboutHeroSection, AboutStorySection |
about/ |
About |
ServicesHeader (the page title inside the grid), PatientGuideSection |
services/ |
Services |
BookingSection (with BookingForm) |
booking/ |
Services, Book |
ServiceDetailSection (with ServiceRichText; it holds the BookingForm too) |
service/ |
Service |
BlogListSection |
blog/ |
Blog |
PostArticleSection, PostOtherSection |
post/ |
Post |
ContactSection |
contact/ |
Contact |
LegalSection |
legal/ |
Legal |
NotFoundSection |
not-found/ |
404 |
CtaSection (the closing call to action) |
CtaSection.tsx |
Home, About, Blog, Post |
WhyChooseUsSection |
WhyChooseUsSection.tsx |
About, Services, Book |
PageHeading, FactsRow |
PageHeading.tsx, FactsRow.tsx |
parts of the page-title sections |
Blocks that pages share
Section titled “Blocks that pages share”Some blocks have one copy that several pages read, so changing it once changes it everywhere:
| Block | Copy | Shown on |
|---|---|---|
| The closing call to action: title, buttons, promises and the video | cta in src/content/site.ts |
Home, About, Blog, every post |
“Why Choose Us”: the title block, and the eight cards of features.ts |
whyChooseUs in site.ts |
About, Services, Book |
| The booking form and the advantages panel’s title | booking in site.ts |
Services, Book, every service page |
| The facts row | facts.ts |
Home (under the hero), About (under the photo) |
| The dentist tabs | doctors.ts; headings in home.ts and about.ts |
Home, About |
Other blocks look the same on two pages but carry their own copy in each page file, so they can differ: the services
grid (services in home.ts, list in services.ts, departments in service.ts), the reviews with their form
(testimonials in home.ts and services.ts) and the dentists’ headings.
How the pages link to each other
Section titled “How the pages link to each other”The menu holds Home, About, Services, Blog and Contact; the header’s buttons call the clinic and open Book. The other pages are reached like this:
| Page | Linked from |
|---|---|
| Book | “Book Appointment” in the header, the Home hero, the call to action and the Services page; the service cards’ “Book a treatment” opens the booking form on the service’s own page (/service/<slug>#booking) |
| A service | Its card (“Learn More”) in every services grid, and the footer’s Dental Services column (footer.services in site.ts) |
| A post | Its card (Home, Blog, “Other Post”) |
| Legal pages | The footer’s legal links (footer.legalLinks in site.ts) |
Page maps
Section titled “Page maps”Every page type with each section outlined and labelled: the component that renders it, the file to edit, and where its
copy (src/content/pages/*.ts, src/content/site.ts) and items (src/content/collections/*.ts) come from. Header and
footer take their links and details from src/content/site.ts. Photos are the placeholders of the download. A section
whose copy is in site.ts (the call to action, “Why Choose Us”, the booking form) or that gets a whole page file shows
no copy line: the text below each map names it.
Eight sections, top to bottom: the hero (eyebrow, title, lead, buttons, the review strip, the photo with its caption and
two badges, and the facts row); “Our Clinical Departments”, the services grid with the department tabs, the search
field and the safety banner; “About Our Clinic” with three photos and the reasons accordion; “Real Patient Outcomes”
with the index and four outcome cards; the dentist tabs; the reviews with the review form; the closing call to action
(cta in site.ts); “Expert Dental Tips” with the first three posts. Their words are in src/content/pages/home.ts.
The grid shows the first six services that match the chosen tab and search (services.limit); the department tabs are
categories.ts.

Five sections: the title with the wide photo (its paragraph, the e-mail, the address and the call number from
contact in site.ts) and the facts row; “About Us” with the review strip, two photos and the Mission, Vision and Story
cards; “Why Choose Us”; the dentist tabs; the closing call to action. The words are in src/content/pages/about.ts.

Services
Section titled “Services”Five sections: the page title with two buttons over the grid of every service (with the tabs and the search); the
Patient Guide (three photos, four first-visit steps, “Still Have Questions?”); the booking band (the advantages panel
beside the booking form, Forms); “Why Choose Us”; the reviews with the review form. The words are in
src/content/pages/services.ts; the booking form is booking in site.ts.

Service
Section titled “Service”Two sections: the service itself (title, description, the wide photo, then a contents card that stays beside the text
on desktop, the three texts — About Services, Services Included, Treatment Process — and “Instant Booking”, the booking
form with this service chosen and its own dentists), and “Our Clinical Departments” with the first six other services
and the safety banner, without tabs or search. Everything about the service is its entry in services.ts; the labels
are in src/content/pages/service.ts. A service without a Treatment Process text leaves that block and its contents
entry out, and the entries are numbered 01/, 02/, … in order.

Two sections: the title and every post as a card, in columns (three on desktop, two on tablets, one on phones), and the
closing call to action. The words are in src/content/pages/blog.ts, the posts in posts.ts.

Three sections: the article (the title, the excerpt, Category, Publish Date and Read Time, the cover and the text),
“Other Post” (the first three other posts of the list) and the closing call to action. The article is the post in
posts.ts; the labels are in src/content/pages/post.ts.

Contact
Section titled “Contact”One section: the title; the contact details (address, phone and WhatsApp, the appointment hotline, the e-mail), the
opening hours and the emergency panel beside the contact form; and a Google Maps view of the address with a “Get
Direction” button. The words, the hours and the form are in src/content/pages/contact.ts (Forms); the
address, e-mail and numbers are contact in src/content/site.ts. The map and the directions are built from
contact.address.

Two sections: the title over the booking band (the advantages panel beside the booking form, with every treatment and
dentist) and “Why Choose Us”. The title is in src/content/pages/book.ts; the form is booking in site.ts.

Legal page
Section titled “Legal page”One section: the title, “Last Updated : “ with its date, and the text. They are the legal page in
src/content/collections/legal.ts; the label is in src/content/pages/legal.ts. The footer links the three demo pages.

Page not found
Section titled “Page not found”One section: the big “404” graphic in the accent colour, a title, a line and a button back to Home. They are in
src/content/pages/not-found.ts.

Reordering or removing a section
Section titled “Reordering or removing a section”Move the lines in the page file, or delete one. To take the outcomes off the home page, delete <OutcomesSection … />
from src/app/page.tsx; its copy in src/content/pages/home.ts can stay or go. Removing a shared block from one page
leaves it on the others (shared blocks).
A few blocks are parts of a bigger section, so they go inside its file: the safety banner under a services grid
(ServicesSection.tsx), the map of Contact (ContactSection.tsx), the review form beside the cards
(TestimonialsSection.tsx) and the video of the call to action (Editing the content).
Adding a page
Section titled “Adding a page”-
Add the URL to
src/content/routes.ts:insurance: "/insurance", -
Add its copy to
src/content/pages/insurance.ts, with ameta(title, description):export const insurance = {meta: {title: "Insurance & Payment",description: "The insurance plans KorDent works with, payment options and how we coordinate cashless treatment for you.",},title: "Insurance & Payment",lead: "We work with most private insurance plans and help you understand your coverage before treatment.",}; -
Create
src/app/insurance/page.tsx:import type { Metadata } from "next";import { CtaSection } from "@/components/sections/CtaSection";import { insurance } from "@/content/pages/insurance";import { routes } from "@/content/routes";import { cta } from "@/content/site";import { Section, cn, text } from "@/design-system";import { pageMeta } from "@/lib/meta";export const metadata: Metadata = pageMeta(routes.insurance, insurance.meta);export default function InsurancePage() {return (<><Section><div className="flex flex-col items-center gap-5 text-center"><h1 className={cn(text.h1, "max-w-[620px]")}>{insurance.title}</h1><p className={cn(text.bodyLarge, "max-w-[620px] text-muted")}>{insurance.lead}</p></div></Section><CtaSection cta={cta} /></>);}The page starts under the header by itself:
<main>is padded by the header’s height (the header). -
Link to it: add
{ label: "Insurance", href: "/insurance" }tonavigationinsrc/content/site.ts(the menu), and tofooter.quickLinksif you want it in the footer. -
Add
routes.insuranceto thepageslist insrc/app/sitemap.ts, next to the other top-level pages.
Removing a page
Section titled “Removing a page”Delete its folder under src/app/, its entry in navigation and the footer’s links (src/content/site.ts), its line
in src/app/sitemap.ts, and the route in routes.ts. npm run build then tells you about anything still using the
route through routes. Links written as text in the content are not checked: the /book, /service and /about of the
buttons, and the footer’s columns, for example. Search src/content/ for the path. Removing Book needs the most care: the
header, the hero, the call to action and the service cards all link to it.
Pages built from a collection
Section titled “Pages built from a collection”src/app/service/[slug]/page.tsx builds one page per service:
export const dynamicParams = false; // only the slugs below exist; anything else is a 404export async function generateStaticParams() { return (await getServices()).map((service) => ({ slug: service.slug }));}Add a service to src/content/collections/services.ts, and its page, its card and its sitemap entry appear on the next
build. The same pattern builds the post pages (src/app/blog/[slug]/page.tsx) and the legal pages
(src/app/legal/[slug]/page.tsx). A slug may contain a dot (a demo post’s does).
The 404 page
Section titled “The 404 page”src/app/not-found.tsx, with its copy in src/content/pages/not-found.ts. Next.js shows it for any unknown address,
and for a service, post or legal slug that doesn’t exist, with a 404 status and noindex, like the style guide.
The header
Section titled “The header”- A white bar at the top of every page, 68 px tall on phones and 78 px from tablets up, that scrolls away with the
page (it is not fixed).
<main>is padded by its height (pt-[68px] md:pt-[78px]insrc/app/layout.tsx). - Desktop: the logo, the menu links and two buttons, “Call Now” (black) and “Book Appointment” (the accent). Tablet: the buttons shrink to their icons. Phone: the logo and a menu button; the menu opens under the bar with the links and both buttons, and closes when a link is followed or the visitor presses Escape.
- The menu is
navigationinsrc/content/site.ts, the buttonsheaderActions. A link is marked current on its own page only (a service, post or legal page marks no link); on hover its letters roll.
Search engines
Section titled “Search engines”- Sitemap:
src/app/sitemap.tsbuildssitemap.xmlfromroutes.tsand the collections: the six main pages (Home, About, Services, Blog, Contact, Book), then every service, post (with its date) and legal page (with its update date): 29 addresses in the demo. The 404 page and the style guide are left out. - Robots:
src/app/robots.tsbuildsrobots.txt, which allows everything and points at the sitemap. Both usesite.url, so set your domain before publishing. - Per page: every indexable page gets a title, a description, a canonical link, an
og:urland a share image frompageMeta(src/lib/meta.ts). The pages with a file insrc/content/pages/write theirs in itsmeta; Home’s description issite.description. The pages built from a collection take theirs from the item: a service its title and summary, a post its title and excerpt (lengthened with its first paragraph when short), a legal page its title and first paragraph. A title that would be longer than 60 characters with| KorDentappended is shown without the suffix. Services and posts share their own photo; posts are shared as articles, with their date. - Not indexed: the style guide and the 404 page (
noindex).