Skip to content
Sign inJoin waitlist

Pages and sections — Semono 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, blogPage.meta);
export default async function BlogPage() {
const posts = await getPosts();
return (
<BlogListSection label={blogPage.label} title={blogPage.title} text={blogPage.text} loading={blogPage.loading} posts={posts.map(toPostCard)} />
);
}
  • 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).
  • The section renders them: the title block, then every post as a card in columns, six at a time on desktop and four on tablets and phones, more as the visitor scrolls.

13 kinds of page and 33 addresses in the demo. Every address is in src/content/routes.ts; note that Services and Careers live at /service and /career, in the singular, so a service is /service/business-strategy.

Page Address Page file Copy (src/content/pages/) Items it shows
Home / src/app/page.tsx home.ts clients, services, testimonials, posts
About /about src/app/about/page.tsx about.ts team, testimonials
Team /team src/app/team/page.tsx team.ts team
Careers /career src/app/career/page.tsx careers.ts careers
Career /career/<slug> src/app/career/[slug]/page.tsx career.ts one position
Services /service src/app/service/page.tsx services.ts services, clients, testimonials
Service /service/<slug> src/app/service/[slug]/page.tsx service.ts one service, four others
Testimonial /testimonial src/app/testimonial/page.tsx testimonials.ts testimonials, posts
Blog /blog src/app/blog/page.tsx blog.ts posts
Post /blog/<slug> src/app/blog/[slug]/page.tsx post.ts one post, related posts
Contact /contact src/app/contact/page.tsx contact.ts —
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).

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
HomeHeroSection, ClientsSection, HomeAboutSection, HomeServicesSection, WhyChooseSection, CtaBandSection, HomeTestimonialsSection, HomeBlogSection one file each Home
ProcessSection (with ProcessTabs) ProcessSection.tsx, ProcessTabs.tsx Home
ActionSection (with ActionCard) ActionSection.tsx, ActionCard.tsx Home, Testimonial
AboutIntroSection, AboutMissionSection, AboutTeamSection one file each About
TeamGridSection TeamGridSection.tsx Team
CareersSection CareersSection.tsx Careers
CareerSection CareerSection.tsx Career
ServicesListSection, ServicesProcessSection, ServicesTestimonialsSection one file each Services
ServiceMainSection, ServiceActionSection, ServiceOtherSection one file each Service
TestimonialsMainSection, LatestPostsSection one file each Testimonial
BlogListSection (with BlogList) BlogListSection.tsx, BlogList.tsx Blog
PostArticleSection, PostRelatedSection one file each Post
ContactSection ContactSection.tsx Contact
LegalSection LegalSection.tsx Legal
NotFoundSection NotFoundSection.tsx 404

Some parts are shared between sections: ClientsRow (the logo ticker) is in ClientsSection.tsx and also ends ServicesProcessSection; ProcessSteps is in ProcessSection.tsx and also on Services; TestimonialMasonry (the grid of client cards) serves HomeTestimonialsSection and ServicesTestimonialsSection.

Some blocks have one copy that several pages read, so changing it once changes it everywhere. Their copy is in src/content/pages/home.ts:

Block Field in home.ts Shown on
The four figures facts Home (“About Semono”), About (the intro)
The four icon cards about.cards Home (“About Semono”), About (“Our Mission & Values”)
The closing call to action: the black card, its buttons and its photo action Home, Testimonial, and (the title, text, first button and photo) the black card of “How We Work” on Services
“Latest Insights”: label, title and text blog Home, Testimonial
The four steps of the process process.steps Home, Services (“How We Work”)
The title over the client logos clients.title Home, Services
The heading over the client cards testimonials Home, Services
“What’s Included:” and “Learn more” on the service rows services.included, services.more Home, Services, “Other services”

To give a page its own words for one of these, write them in that page’s own file instead of reading Home’s: for example, testimonials in src/content/pages/services.ts is homePage.testimonials; replace it with an object of your own.

The menu holds Home, About, Services and Blog, and the “Contact us” button. The other pages are reached like this:

Page Linked from
Team The black card at the end of About’s team row, “View full team” (team.more.link in about.ts)
Careers The footer’s Quick Links (footer.quickLinks in site.ts) and the black card of the Team page, “We are hiring” (join.link in team.ts)
A career The “More details” button of each position on Careers
Testimonial “View all reviews” in “Why Choose Semono” on Home (why.story.link in home.ts)
A service The “Learn more” of every row (Home, Services, “Other services”) and the footer’s Services column
A post Its card (Home, Blog, Testimonial, “Related articles”)
Legal pages The footer’s legal links (footer.legalLinks in site.ts)

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.

Ten sections, top to bottom: the hero; “Trusted by leading brands” (the logo ticker); “About Semono” with four figures; “Our Services” with the closing line, a client quote and the video; “Why Choose Semono”; a photo band with a call to action; the process (four steps and three tabs); “Client Testimonials”; a closing call to action; “Latest Insights”. Their words are in src/content/pages/home.ts, and so are the figures, the six reasons, the tabs and the booking link. The ticker shows every client of clients.ts; the rows of “Our Services” are the first four services (services.limit); the quote beside the closing line is the fourth testimonial and the client story in “Why Choose” the first (the grid of cards shows up to eight, Editing the content); “Latest Insights” shows the first three posts. The header lies over the hero and turns light when “About Semono” reaches the middle of the screen (the header).

Home: sections and the files behind them

Three sections: the intro (the title, a wide photo, “Our Story” and the four figures), “Our Mission & Values” (four cards, the video, a closing line with a client quote) and “Our Team”. The words are in src/content/pages/about.ts; the figures and the four cards are Home’s (shared blocks). The quote is the third testimonial; the team row shows the first three members of team.ts (team.limit) and a black card linking to the Team page.

About: sections and the files behind them

One section: the title, every member of team.ts as a card (portrait, LinkedIn button, name and role), a wide photo and a black card inviting to Careers. The words, the photo and the card are in src/content/pages/team.ts.

Team: sections and the files behind them

One section: the title, three photos beside four cards (perks), and “Open Positions”: every position of careers.ts as a row with a “More details” button (no paging). The words, the photos and the cards are in src/content/pages/careers.ts.

Careers: sections and the files behind them

One section: the position’s title, its location and type, the overview and three bulleted lists, and a white card with the application form (Forms). All the text is the position in careers.ts; the labels and the form are in src/content/pages/career.ts. One page exists per position, and its browser title is the title with its location.

Career: sections and the files behind them

Three sections: the title and every service as a numbered row, four at a time as the visitor scrolls (all six are in the page’s HTML); “How We Work” (four steps, a black card with a button and a photo, and the client logos); and the grid of client cards. The words are in src/content/pages/services.ts; the steps, the card, the logos’ title and the cards’ heading are Home’s (shared blocks). The rows are services.ts, the logos clients.ts and the cards testimonials.ts.

Services: sections and the files behind them

Three sections: the main part (the service’s name and summary, a wide photo, the overview beside “What’s Included”, a gallery of three photos beside four “What We Deliver” cards, and four numbers), a white card with the consultation form beside a photo (Forms), and “Other services” (four rows and a button to all of them). Everything in the main part is the service in services.ts; the labels, the card’s text and photo, the form and “Other services” are in src/content/pages/service.ts. The “Service Required” field of the form starts with the page’s own service.

Service: sections and the files behind them

Three sections: every client story as a wide row (four at a time as the visitor scrolls), the closing call to action and “Latest Insights” with the first three posts. The stories are testimonials.ts; the title is in src/content/pages/testimonials.ts; the closing card and the heading of “Latest Insights” are Home’s (shared blocks).

Testimonial: sections and the files behind them

One section: the title and every post as a card in columns (three on desktop, two on tablets, one on phones): six at first on desktop, four on tablets and phones, and more each time the spinner under the list comes within about 500 px of the screen. Every post is in the page’s HTML from the start, so search engines find them all. The words are in src/content/pages/blog.ts, the posts in posts.ts.

Blog: sections and the files behind them

Two sections: the article (the title, the excerpt, the category and date, the wide cover and the text) and “Related articles”, up to three other posts of the same category; the section is left out when there are none. The article is the post in posts.ts; the heading is in src/content/pages/post.ts.

Post: sections and the files behind them

One section: the title; the contact details beside the inquiry form; and the FAQ of eight questions. The title, the labels, the business hours, the FAQ and the form are in src/content/pages/contact.ts (Forms); the e-mail, the phone number and the address are contact in src/content/site.ts.

Contact: sections and the files behind them

One section: the title, “Last updated on” with its date, and the text. They are the legal page in src/content/collections/legal.ts; “Last updated on” is in src/content/pages/legal.ts. The footer links the two demo pages.

Legal page: sections and the files behind them

One section: a full-window photo under a dark layer with the header floating over it, a title, a text and a button back to Home. They are in src/content/pages/not-found.ts.

Page not found: sections and the files behind them

Move the lines in the page file, or delete one. To take the process off the home page, delete <ProcessSection … /> from src/app/page.tsx; its copy in src/content/pages/home.ts can stay or go, but keep what another page reads (shared blocks: the Services page reads process.steps, for example).

A few blocks are parts of a bigger section, so they go inside its file: the FAQ of Contact (everything under the <hr /> in ContactSection.tsx), the closing line and quote of “Our Services” (<ActionQuote … /> in HomeServicesSection.tsx) and the two videos (Editing the content).

On Home, the header turns light at the “About Semono” block, the section marked headerSwitch (<Section id="about" headerSwitch> in HomeAboutSection.tsx). If you remove HomeAboutSection, put headerSwitch on the section that should take over, or the header stays transparent, with white text, all the way down Home.

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

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

    export const industriesPage = {
    meta: {
    title: "Industries",
    description: "The industries Semono works with: technology, finance, corporate services and fast-growing start-ups.",
    },
    label: "Industries",
    title: "Experience across every kind of business",
    text: "From start-ups to established groups, we adapt our consulting approach to the way your industry works.",
    };
  3. Create src/app/industries/page.tsx:

    import type { Metadata } from "next";
    import { ActionSection } from "@/components/sections/ActionSection";
    import { homePage } from "@/content/pages/home";
    import { industriesPage } from "@/content/pages/industries";
    import { routes } from "@/content/routes";
    import { site } from "@/content/site";
    import { PageTitle, Section } from "@/design-system";
    import { pageMeta } from "@/lib/meta";
    export const metadata: Metadata = pageMeta(routes.industries, industriesPage.meta);
    export default function IndustriesPage() {
    return (
    <>
    <Section>
    <PageTitle label={industriesPage.label} title={industriesPage.title} text={industriesPage.text} balance />
    </Section>
    <ActionSection {...homePage.action} name={site.name} />
    </>
    );
    }

    The page starts under the fixed header by itself: <main> is padded by the header’s height, so the first section needs no extra space (the header). ActionSection here is Home’s closing call to action.

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

  5. Add routes.industries 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 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: removing Team stops about.ts, and removing Careers stops team.ts. Links written as text in the content are not checked: the /contact, /service, /about and /testimonial of the buttons, and the footer’s Quick Links, for example. Search src/content/ for the path.

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 row and its sitemap entry appear on the next build. The same pattern builds the post pages (src/app/blog/[slug]/page.tsx), the career pages (src/app/career/[slug]/page.tsx) and the legal pages (src/app/legal/[slug]/page.tsx).

src/app/not-found.tsx, with its copy and photo in src/content/pages/not-found.ts. Next.js shows it for any unknown address, and for a service, post, career or legal slug that doesn’t exist, with a 404 status and noindex, like the style guide.

  • Fixed, and it never hides. The header stays at the top of every page while the visitor scrolls. It is 58 px tall on phones and 82 px from tablets up.
  • Over the photo on Home and the 404 page. Both open with a full-window photo whose section carries data-header-cover (HomeHeroSection.tsx, NotFoundSection.tsx). There the header is transparent, with a white logo and links, over the photo. On Home it turns light (the page background with black text) once the “About Semono” block reaches the middle of the screen, fading in 0.37 s, and goes transparent again when the visitor scrolls back above that point. The 404 page has no such block, so its header stays transparent.
  • Every other page starts below a spacer: the header is light from the first paint, and <main> is padded by its height (pt-[58px] md:pt-[82px] in src/app/layout.tsx).
  • Changing it. To put the header over a photo on another page, start that page with a dark, full-window section marked data-header-cover: it must be a direct child of <main>, which then loses its padding. Mark a later section with headerSwitch (a prop of Section) if the header should turn light there. To give Home the light header of the other pages, remove the mark from HomeHeroSection.tsx. The looks are chosen in CSS (body:has([data-header-cover]) in src/components/site/Header.tsx), so nothing jumps after the page loads.
  • The menu is navigation in src/content/site.ts, and the button contactLink. The link of the current page looks like the others; screen readers hear it as the current page (a service, post, career or legal page marks no link). On phones the bar holds the logo and a menu button of three lines; the menu opens under the bar with the links and the “Contact us” button, and closes when a link is followed, when the visitor presses Escape and when the page changes.
  • Sitemap: src/app/sitemap.ts builds sitemap.xml from routes.ts and the collections: the eight main pages (Home, About, Team, Careers, Services, Blog, Contact, Testimonial), then every position, service, post (with its date) and legal page (with its update date): 33 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 a share image from pageMeta (src/lib/meta.ts). The pages with a file in src/content/pages/ write theirs in its meta (a title of at most 60 characters and a description of 80 to 160: the demo’s are); Home uses site.title and site.description. The pages built from a collection take theirs from the item: a service its name and summary, a career its title with its location and its summary, a post its title and excerpt, a legal page its title and first paragraph. A title that would be longer than 60 characters with | Semono appended 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).