Pages and sections — Brickfolio Next.js
A page is a small file that picks sections and hands them content. src/app/page.tsx is the whole of Home: the profile card, then the sections in the order they appear, then the footer.
<main className="flex flex-col gap-20 lg:contents"> <Profile className="… lg:sticky lg:top-[150px] …" /> <Projects projects={projects} className={column} /> <Services services={services} className={column} /> <ServicesCta className={column} /> <Testimonials className={column} /> <Experience className={column} /> <Clients className={column} /> <Blog posts={posts} className={column} /> <Contact className={column} /> <Faq className={column} /> <Divider className={column} /></main><Footer copyrightInSidebar className={column} />pageMeta(route, meta)(src/lib/meta.ts) gives a page its browser title, description, canonical link and share image.getProjects(),getServices()andgetPosts()read the collections (see Editing the content).- Each section reads its own copy from
src/content/pages/home.ts, so the page passes only the collections. - From 1000 px up,
<main>isdisplay: contents: the profile card takes the first column of a grid and sticks (lg:sticky), the sections and the footer take the second (column,lg:col-start-2).
The pages
Section titled “The pages”4 kinds of page and 19 addresses in the demo. Every address is built from src/content/routes.ts.
| Page | Address | Page file | Copy (src/content/pages/) |
Items it shows |
|---|---|---|---|---|
| Home | / |
src/app/page.tsx |
home.ts |
every project (four at a time), every service, every post (four at a time, newest first) |
| Project | /project/<slug> |
src/app/project/[slug]/page.tsx |
project.ts |
one project, then three other projects |
| Blog post | /blog/<slug> |
src/app/blog/[slug]/page.tsx |
post.ts |
one post, then up to three others of its category |
| 404 | any unknown address | src/app/not-found.tsx |
not-found.ts |
— |
All 19 addresses of the demo (the sitemap lists the same):
| Page | Addresses |
|---|---|
| Home (1) | / |
| Projects (6) | /project/ecoshop-sustainable-e-commerce-platform, /project/greenthumb-gardening-app, /project/foodiefiesta-restaurant-reservation-system, /project/techhub-online-learning-platform, /project/cityguide-travel-website, /project/healthtrack-fitness-app |
| Posts (12) | /blog/the-role-of-prototyping-in-product-design, /blog/designing-for-user-experience-key-considerations, /blog/the-future-of-product-design-trends-to-watch-in-2024, /blog/10-essential-web-design-principles-for-2024, /blog/responsive-web-design-best-practices-and-tips, /blog/creating-high-converting-landing-pages, /blog/how-to-create-user-centric-products-a-step-by-step-guide, /blog/conducting-effective-user-research-for-better-ui-design, /blog/sustainable-product-design-practices-and-benefits, /blog/ui-design-trends-to-elevate-your-digital-products, /blog/the-impact-of-microinteractions-on-ux, /blog/the-importance-of-ux-in-modern-web-design |
There is no page that lists every project or every post: Home does, four at a time. The style guide (/style-guide,
src/app/style-guide/) and the 404 page are pages too, but they are not in the sitemap, are hidden from search engines
and linked from nowhere.
To change an address, rename its folder in src/app/ and its entry in routes.ts.
The sections you can use
Section titled “The sections you can use”In src/components/sections/, one file each (two in Services.tsx and MoreItems.tsx). Each takes its copy from the
page file it belongs to.
| Section | Used on | Copy |
|---|---|---|
Profile (the photo, the greeting, the rotating roles, the headline, the text, the social links; the copyright from 1440 px) |
Home | home.profile, social and footer.copyright in site.ts |
Projects (My Latest Work: the project cards, “More Projects”) |
Home | home.projects |
Services (Work with Me: the service cards) |
Home | home.services |
ServicesCta (“Can’t decide or custom request?” with “Email me” and “Contact”) |
Home | home.services.cta |
Testimonials (Trusted by Professionals: the ticker of quotes) |
Home | home.testimonials |
Experience (My Experiences: the cards, “Download CV”, “Contact Me”) |
Home | home.experience |
Clients (My Awesome Clients: the logo ticker) |
Home | home.clients |
Blog (Latest Articles & Publications: the post cards, “More Posts”) |
Home | home.blog |
Contact (Let’s Connect: the form) |
Home | home.contact |
Faq (Questions? Answers) |
Home | home.faq |
ProjectArticle (the title, the facts, the cover, the overview, the gallery, the highlights) |
Project | project.labels |
MoreProjects (in MoreItems.tsx) |
Project | project.more |
PostArticle (the title, the date and category, the cover, the text) |
Blog post | post.labels |
MorePosts (in MoreItems.tsx) |
Blog post | post.more |
The section titles with their accent word are SectionTitle, the lines between blocks Divider, helpers of the design
system, not sections.
How the pages link to each other
Section titled “How the pages link to each other”The header’s links lead to Home’s sections; the logo leads to the top of Home. The other pages are reached like this:
| Page | Linked from |
|---|---|
| Home | The logo, the header’s links (/#project, /#service, /#resume, /#blog, /#contact), the close button of a project or post page (back to its section), “Back to Homepage” (404) |
| A project | Its card: My Latest Work on Home, “More Projects” under another project |
| A post | Its card: Latest Articles & Publications on Home, “More Posts” under another post |
/cv.pdf |
“Download CV” in My Experiences |
Page maps
Section titled “Page maps”Every page type with each section outlined and labelled: the component that renders it, the copy it reads and the
collections its items come from. The header and the footer take their texts from src/content/site.ts. Photos are the
placeholders of the download; the maps are taken at 1200 px, where the profile card is the sidebar.
Eleven blocks in <main>: the profile card in the sidebar, then My Latest Work, Work with Me, the call to get in touch,
the testimonials, the experience, the client logos, the articles, the contact form, the questions and a line, and the
footer (the newsletter box and the copyright line) under them. All the copy is in src/content/pages/home.ts, one field
per section (Editing the content).

Project
Section titled “Project”Three blocks: the article (the title, Date, Service and Client, the cover, Project Overview, two gallery images, Key
Highlights, the third image), a line, and More Projects (the first three other projects of projects.ts; two below
1000 px). Everything but the labels (src/content/pages/project.ts) is the project’s own entry in
src/content/collections/projects.ts. The round close button stays at the bottom of the window and leads back to My
Latest Work.

Blog post
Section titled “Blog post”Three blocks: the article (the title, Date and Category, the cover and the text), a line, and More Posts (up to three
other posts of the same category, newest first), left out with its line when there is none. Everything but the labels
(src/content/pages/post.ts) is the post’s entry in src/content/collections/posts.ts. The close button leads back to
the articles on Home.

Two blocks in the middle of a screen-high space: “404”, the message and the line under it; “Back to Homepage”. The words
are in src/content/pages/not-found.ts. The page has no footer, as in the original design.

Reordering or removing a section
Section titled “Reordering or removing a section”Move the lines in src/app/page.tsx, or delete one. To take the testimonials off Home, delete <Testimonials … />; its
copy in home.ts can stay. Two things to keep in step:
- The anchors. The header’s links point at the sections’
ids (project,service,resume,blog,contact). When you remove a section with an anchor, remove its link fromnavigationinsrc/content/site.ts; the “Contact” and “Hire Me” buttons and the close buttons point at#contact,#projectand#blogtoo. - The sidebar’s rows. From 1000 px the profile card spans the rows of the grid:
lg:row-span-11on<Profile>counts the blocks of the column (nine sections, the line and the footer). With a block more or less, change the number, or the card stops sticking before the end of the page.
Adding a section
Section titled “Adding a section”-
Add its copy to
src/content/pages/home.ts, with anidif the header should link to it:awards: { id: "awards", title: "Awards and", accent: "Mentions", text: "A few moments I am proud of." }, -
Create
src/components/sections/Awards.tsx:import { Section, SectionTitle } from "@/design-system";import { home } from "@/content/pages/home";export function Awards({ className }: { className?: string }) {const copy = home.awards;return (<Section id={copy.id} className={className}><SectionTitle title={copy.title} accent={copy.accent} text={copy.text} /></Section>);} -
Put
<Awards className={column} />where it belongs insrc/app/page.tsx, and raiselg:row-span-11to 12. -
To link it from the header, add
{ "label": "Awards", "href": "#awards" }tonavigationinsrc/content/site.ts. The header holds five links on laptops: with a sixth, check it at 1000 px.
Adding a page
Section titled “Adding a page”-
Add the URL to
src/content/routes.ts:about: "/about",. -
Add its copy to
src/content/pages/about.ts:export const about = {title: "About me",description: "Who I am, how I work and what I can do for your product: a short story of ten years in design.",text: "A longer introduction than the profile card has room for.",}; -
Create
src/app/about/page.tsx, in the column the project and post pages use:import type { Metadata } from "next";import { about } from "@/content/pages/about";import { routes } from "@/content/routes";import { cn, text } from "@/design-system";import { PageColumn } from "@/components/site/PageColumn";import { pageMeta } from "@/lib/meta";export const metadata: Metadata = pageMeta(routes.about, { title: about.title, description: about.description });export default function AboutPage() {return (<PageColumn><main className="flex flex-col gap-5"><h1 className={cn(text.title, "text-light")}>{about.title}</h1><p className={cn(text.body, "text-white/80")}>{about.text}</p></main></PageColumn>);}PageColumn(src/components/site/PageColumn.tsx) adds the footer under the page’s<main>. Give every page one<h1>. -
Link to it: add
{ "label": "About", "href": "/about" }tonavigationinsrc/content/site.ts. -
Add
routes.aboutto thepathslist insrc/app/sitemap.ts, next toroutes.home.
Removing a page
Section titled “Removing a page”A project or a post: delete its entry in the collection. A page you added: delete its folder under src/app/, its entry
in navigation, the route in routes.ts and its place in src/app/sitemap.ts. npm run build then tells you about
anything still using the route through routes.
Pages built from a collection
Section titled “Pages built from a collection”src/app/project/[slug]/page.tsx builds one page per project:
export const dynamicParams = false;
export async function generateStaticParams() { return (await getProjects()).map((project) => ({ slug: project.slug }));}Add a project to src/content/collections/projects.ts, and its page, its card and its sitemap entry appear on the next
build. The posts work the same way (src/app/blog/[slug]/page.tsx). dynamicParams = false means an address that isn’t
in the collection shows the 404 page.
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 project or post slug that doesn’t exist, with a 404 status and noindex, like the style guide. Its three lines are
sized to fit the width of the column (as the original design does), for the demo’s words: with a much longer message,
change the sizes in fit at the top of the file.
The header
Section titled “The header”- Sticky at the top of every page, and the same everywhere: the logo, then on tablets and up the five links and the “Hire Me” pill, over a line in White 10 %.
- Phones: the logo and the “Menu” button; it opens the links and the pill under the bar and turns into “Close”. A link closes it.
- The links are
navigationinsrc/content/site.ts, the pillbutton. They underline in Light on hover.
The project and post pages
Section titled “The project and post pages”Both are a 1000 px column with the article, a line, “More Projects” or “More Posts” and the footer, and a round close
button fixed at the bottom of the window. The close button leads back to the Home section the visitor came from
(close.href in project.ts and post.ts) and only it takes the pointer, so the strip under it stays clickable.
The footer
Section titled “The footer”src/components/site/Footer.tsx: the newsletter box (its title, its text and the e-mail field with “Subscribe”) and the
copyright line under it. On Home from 1440 px the copyright line sits at the foot of the profile card instead. Its texts
are footer in src/content/site.ts; the newsletter box is described in Forms.
Search engines
Section titled “Search engines”- Sitemap:
src/app/sitemap.tsbuildssitemap.xmlfromroutes.tsand the collections: Home, then every project and every post: 19 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 and an
og:urlfrompageMeta(src/lib/meta.ts). Home takessite.titleandsite.description. A project’s description is its summary, a post’s its first paragraph, each cut at 160 characters, and both share their own cover photo as a large card. Home has no share image, as in the original design, so it shares its title and description only. A title that would be longer than 60 characters with| Brickfolioappended is shown without the suffix. - One
<h1>per page: the headline of the profile card on Home, the title of a project or a post, the 404’s message. - Not indexed: the style guide and the 404 page (
noindex).