Skip to content
Sign inJoin waitlist

Pages and sections — Catchup 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 = pageMeta(routes.blog, { title: blog.meta.title, description: blog.meta.description });
export default async function BlogPage() {
const posts = await getPosts();
return (
<>
<HeaderSpacer />
<BlogList title={blog.title} label={blog.label} lead={blog.lead} cards={posts.map(toPostCard)} pageSize={blog.pageSize} loading={blog.loading} />
</>
);
}
  • pageMeta(route, meta) gives the page its browser title, description, canonical link and share image.
  • getPosts() reads the collection (see Editing the content). toPostCard turns each post into what a card shows (src/lib/to-ui.ts).
  • HeaderSpacer keeps the page’s top clear of the fixed header; the section renders the title, the lead and the posts.

11 kinds of page and 28 addresses in the demo’s sitemap. Every address is in src/content/routes.ts.

Page Address Page file Copy (src/content/pages/) Items it shows
Home / src/app/page.tsx home.ts every project, service and testimonial, the three newest posts
About /about src/app/about/page.tsx about.ts the first four testimonials’ faces
Work /work src/app/work/page.tsx work.ts (workPage) every project
Project /work/<slug> src/app/work/[slug]/page.tsx work.ts (workItemPage) one project, its services, its client’s quote, two other projects
Services /service src/app/service/page.tsx services.ts (servicesPage) every service
Service /service/<slug> src/app/service/[slug]/page.tsx services.ts (serviceItemPage) one service, the client of each plan, every other service
Blog /blog src/app/blog/page.tsx blog.ts every post, newest first
Post /blog/<slug> src/app/blog/[slug]/page.tsx post.ts one post, up to two more of its category
Contact /contact src/app/contact/page.tsx contact.ts —
Legal /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 —

The header and the footer are on every page (src/app/layout.tsx). The style guide (/style-guide, src/app/style-guide/) is a page too, for you: it is hidden from search engines and linked from nowhere.

The addresses are the original design’s: /service for the services and /work for the projects. 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).

In src/components/sections/. Each takes its copy from a page file (or site.ts) and its items from a collection.

Section File Used on
HomeIntro, HomeHero, HomeLogos, HomeAbout, HomeServices, HomeWorks, HomeTestimonials, HomeCta, HomeBlog one file each Home
AboutTitle, AboutPhilosophy, AboutProcess, AboutAwards, AboutTeam one file each About
WorkList WorkList.tsx Work
WorkItemHero (with the Details and Credits tables of WorkItemDetails.tsx), WorkItemStory, WorkItemOther WorkItem.tsx Project
ServicesList ServicesList.tsx Services
ServiceHero, ServiceOffer, ServiceMore ServiceItem.tsx Service
ServicePricing ServicePricing.tsx Service
BlogList (with BlogGrid, the posts that load as you scroll) BlogList.tsx, BlogGrid.tsx Blog
PostArticle, PostMore one file each Post
ContactMain ContactMain.tsx Contact
LegalPage LegalPage.tsx Legal
NotFoundMain NotFoundMain.tsx 404

PageTitle.tsx holds HeaderSpacer (the space under the fixed header at the top of every inner page) and TitleBlock (the title, the line beside it and the lead of About, Work, Services and a project page). TallAppear.tsx is the scroll animation of a post’s article.

The menu holds Home, Studio (About), Works, Services and Insights (Blog), with the Contact button beside it; the logo leads home. The footer’s Sitemap column repeats the main pages. The other pages are reached like this:

Page Linked from
A project The Home hero’s titles, its card (Home’s “Our Work”, Work, “Other works”), the footer’s Recent Works
A service Its card (Home’s “What We Do”, “More Services”), “Learn More” on Services, the tags of the project cards, “Services :” on a project page, the footer’s Services
A post Its card: Home’s “News & Insights”, Blog, “More Blog”
A legal page The footer’s bottom row, the consent line under the Contact form; the Terms link the Privacy Policy
Work The menu, “View All Works” (Home, a project page), “See Our Work” (Home)
Services The menu, “Our Services” (Home)
Blog The menu, “View All” (Home), “Blog” in a post’s breadcrumb
About The menu, “More About Us” (Home)
Contact The menu’s button, “Let’s Collaborate”, “Let’s Connect” and “Start Your Project” (Home), “Let’s Connect” (About), “Start a Project” (Work, Services)

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. The sections of a project, a service, a post and a legal page show their item’s own content, so their labels name the collection; the fixed words are in the page copy named in each description.

Nine sections, top to bottom: the intro (the projects’ photos and the logo over a black cover, once per visit; it takes no room on the page), the hero (the projects’ photos as a slideshow with their titles, the tag, the title, the text and two buttons), the client logos, “About Us” (five numbers with photos and “Core Values”), “What We Do” (every service as a card and the mint call-to-action card), “Our Work” (every project as a card), the testimonials, the call to action with its photo, and “News & Insights” (the three newest posts). The words are in src/content/pages/home.ts.

Home: sections and the files behind them

Five sections: the title (the subtitle, the text, the clients’ faces with the count and the rating, the wide photo); “Our Philosophy” (vision and mission, two photos and four numbers); “Our Process” (four steps); “Awards” (the table and two photos); “Teams” (three people). The words are in src/content/pages/about.ts; the faces are the first four testimonials.

About: sections and the files behind them

One section: the title with the years, the text and “Start a Project”, then every project as a card, in the order of src/content/collections/work.ts. The words are workPage in src/content/pages/work.ts.

Work: sections and the files behind them

Five sections: the title with the introduction, the Details and Credits tables and the wide photo with the client’s logo; The Challenge (two photos); Our Solution (three photos); The Outcome (with the client’s quote); “Other works” (two other projects and “View All Works”). The fixed words are workItemPage in src/content/pages/work.ts; everything else is the project’s own entry in src/content/collections/work.ts, and the quote is the testimonial that names the project.

Project: sections and the files behind them

One section: the title, the tagline, the text and “Start a Project”, then every service as a card with its photo, its first four deliverables and “Learn More”, the photo alternating sides on desktops. The words are servicesPage in src/content/pages/services.ts.

Services: sections and the files behind them

Four sections: the title (the service’s name, its overview and its photo); “What We Offer” (the offer and every deliverable, beside a square image); “Pricing Options” (the Per Project / Per Month switch, the plan and its client); “More Services” (every other service). The fixed words are serviceItemPage in src/content/pages/services.ts; everything else is the service’s own entry in src/content/collections/services.ts, and the clients come from the testimonials.

Service: sections and the files behind them

One section: the title, the short line, the lead, and the posts, newest first, four more each time the visitor scrolls near the end of the list. The words are in src/content/pages/blog.ts.

Blog: sections and the files behind them

Two sections: the article (the breadcrumb, the title, the excerpt, the cover, the date and category, the text) and “More Blog” (up to two more posts of the same category; left out when there are none). The fixed words are in src/content/pages/post.ts; everything else is the post’s own entry in src/content/collections/posts.ts.

Post: sections and the files behind them

One section: the title, the text, the details (e-mail, phone, location, hours, the social links) and the inquiry form with the consent line. The words and the form are in src/content/pages/contact.ts (Forms); the e-mail, the phone and the social links in src/content/site.ts.

Contact: sections and the files behind them

One section: the title, the date and the text. The page is the item’s own entry in src/content/collections/legal.ts; “Last updated:” is in src/content/pages/legal.ts.

Legal: sections and the files behind them

One section, one screen tall: “404 Error”, the heading, the text and “Go to Homepage”. The words are in src/content/pages/not-found.ts.

404: sections and the files behind them

Move the lines in the page file, or delete one. To take the call to action off the home page, delete <HomeCta … /> from src/app/page.tsx; its copy in src/content/pages/home.ts can stay or go.

A few blocks are parts of a bigger section, so they go inside its file: the numbers and “Core Values” of Home’s “About Us” (HomeAbout.tsx), the mint call-to-action card of “What We Do” (HomeServices.tsx), the four numbers of “Our Philosophy” (AboutPhilosophy.tsx), the Details and Credits tables of a project (WorkItemDetails.tsx, inside WorkItemHero), the client’s quote under The Outcome (WorkItemStory in WorkItem.tsx) and the details beside the Contact form (ContactMain.tsx).

  1. Add the URL to src/content/routes.ts:

    careers: "/careers",
  2. Add its copy to src/content/pages/careers.ts, with a meta (title, description):

    import type { Link } from "../types";
    export const careersPage = {
    meta: {
    title: "Careers",
    description: "Join the studio: open roles in branding, design, development and photography, and how we work together.",
    },
    label: "Careers",
    title: "Work With Us",
    text: "We’re always glad to meet strategists, designers, developers and photographers who care about craft.",
    action: { label: "Get in Touch", href: "/contact" } as Link,
    };
  3. Create src/app/careers/page.tsx:

    import { HeaderSpacer } from "@/components/sections/PageTitle";
    import { careersPage } from "@/content/pages/careers";
    import { routes } from "@/content/routes";
    import { Button, Section, SectionIntro, text } from "@/design-system";
    import { pageMeta } from "@/lib/meta";
    export const metadata = pageMeta(routes.careers, { title: careersPage.meta.title, description: careersPage.meta.description });
    export default function CareersPage() {
    return (
    <>
    <HeaderSpacer />
    <Section>
    <SectionIntro
    as="h1"
    titleClassName={text.h1}
    label={careersPage.label}
    title={careersPage.title}
    lead={careersPage.text}
    action={<Button href={careersPage.action.href}>{careersPage.action.label}</Button>}
    />
    </Section>
    </>
    );
    }

    HeaderSpacer keeps the top of the page clear of the fixed header. Give every page one <h1>: here the title of SectionIntro (as="h1").

  4. Link to it: add { label: "Careers", href: "/careers" } to navigation in src/content/site.ts (the menu), and to footer.sitemap if you want it in the footer.

  5. Add routes.careers to the pages list in src/app/sitemap.ts, next to the other top-level pages.

Delete its folder under src/app/, its entry in navigation and the footer’s Sitemap links (src/content/site.ts), its entry in the pages list of 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 /contact, /work, /service and /blog of the buttons, and the footer’s Sitemap links, for example. Search src/content/ for the path.

To drop the blog, also take the posts out of Home (<HomeBlog … /> in src/app/page.tsx) and out of src/app/sitemap.ts. To drop the legal pages, change the consent line under the Contact form (consent in src/content/pages/contact.ts and ContactMain.tsx).

src/app/service/[slug]/page.tsx builds one page per service:

export const dynamicParams = false; // only the slugs below exist; anything else is a 404
export async function generateStaticParams() {
return (await getServices()).map((service) => ({ slug: service.slug }));
}

Add a service to src/content/collections/services.ts, and its page, its cards, its footer link and its sitemap entry appear on the next build. The same pattern builds the project pages (src/app/work/[slug]/page.tsx), the posts (src/app/blog/[slug]/page.tsx) and the legal pages (src/app/legal/[slug]/page.tsx).

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 project, service, post or legal slug that doesn’t exist, with a 404 status and noindex.

  • On Home, a see-through bar with the white logo and links sits over the hero and scrolls away with it; once the page has scrolled past the hero, a fixed bar in the page colour fades in (and out again above it). On every other page the fixed bar is there from the start. It is 60 px tall on phones, 90 on tablets and 100 on desktops.
  • Desktop and tablet: the logo on the left, the links in the middle, the mint Contact button on the right. Phone: the logo and a “Menu” button.
  • The menu is navigation in src/content/site.ts, and the button is headerAction. The link of the current page looks like the others; screen readers hear it as the current page. On phones the menu button’s lines cross into an X and the bar grows over the page with the links and the Contact button; it closes when the bar is tapped, when the visitor presses Escape, when the page changes and when the window grows to tablet width.
  • Sitemap: src/app/sitemap.ts builds sitemap.xml from routes.ts and the collections: the six main pages (Home, About, Work, Services, Contact, Blog), then every post and legal page (with its date), every project and every service: 28 addresses in the demo. The 404 page and the style guide are left out.
  • Robots: src/app/robots.ts builds robots.txt, which allows everything and points at the sitemap. Both use site.url, so set your domain before publishing.
  • Per page: every indexable page gets a title, a description, a canonical link, an og:url and the share image from pageMeta (src/lib/meta.ts). The pages with a file in src/content/pages/ write theirs in its meta (a description of 80 to 160 characters: the demo’s are); Home’s title is used as it is, without the suffix. The pages built from a collection take theirs from the item: a project its title and summary, a service its name and overview text, a post its title and excerpt, a legal page its title and first paragraph; a text under 80 characters is followed by the start of the next one (the challenge, the offer, the post’s first paragraph). A title that would be longer than 60 characters with | Catchup appended is shown without the suffix. Posts are shared as articles, with their date and category.
  • One <h1> per page: the hero’s title on Home, the page or item title elsewhere.
  • Not indexed: the style guide and the 404 page (noindex).