Pages and sections — Brickfolio Astro
A page is a small file that picks sections and hands them content. src/pages/index.astro is the whole of Home: the profile card, then the sections in the order they appear, then the footer.
<Layout title={siteContent.site.title} absolute description={siteContent.site.description}> … <main class="flex flex-col gap-20 lg:contents"> <Profile class="… lg:sticky lg:top-[150px] lg:row-span-11 …" /> <Projects projects={projects} class={column} /> <Services services={services} class={column} /> <ServicesCta class={column} /> <Testimonials class={column} /> <Experience class={column} /> <Clients class={column} /> <Blog posts={posts} class={column} /> <Contact class={column} /> <Faq class={column} /> <Divider class={column} /> </main> <Footer copyrightInSidebar class={column} /> …</Layout>Layout(src/layouts/Layout.astro) gives a page its<head>— browser title, description, canonical link, share card and icons — and the sticky header.titleis shown as “| Brickfolio” ( absolutekeeps it whole).getProjects(),getServices()andgetPosts()read the collections (see Editing the content).- Each section reads its own copy from
src/content/pages/home.json, 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/pages/index.astro |
home.json |
every project (four at a time), every service, every post (four at a time, newest first) |
| Project | /project/<slug> |
src/pages/project/[slug].astro |
project.json |
one project, then three other projects |
| Blog post | /blog/<slug> |
src/pages/blog/[slug].astro |
post.json |
one post, then up to three others of its category |
| 404 | any unknown address | src/pages/404.astro |
not-found.json |
— |
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/pages/style-guide.astro) and the 404 page are pages too, but they are not in the sitemap, are hidden from search
engines and linked from nowhere.
The site builds every page as a file (build: { format: "file" } in astro.config.mjs): project/ecoshop-….html,
served at /project/ecoshop-… (Going live). To change an address, rename its file or folder in
src/pages/ 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. 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.json |
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.json → labels |
PostArticle (the title, the date and category, the cover, the text) |
Blog post | post.json → labels |
MoreItems (“More Projects” with projects, “More Posts” with posts) |
Project, Blog post | more in project.json / post.json |
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.json. 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.json, 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.json; two below
1000 px). Everything but the labels (src/content/pages/project.json) is the project’s own entry in
src/content/collections/projects.json. 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.json) is the post’s entry in src/content/collections/posts.json. 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.json. 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/pages/index.astro, or delete one. To take the testimonials off Home, delete <Testimonials … />;
its copy in home.json 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.json; 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.json, 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.astro:---import Section from "../../design-system/components/layout/Section.astro";import SectionTitle from "../../design-system/components/layout/SectionTitle.astro";import home from "../../content/pages/home.json";const { class: className } = Astro.props;const copy = home.awards;---<Section id={copy.id} class={className}><SectionTitle title={copy.title} accent={copy.accent} text={copy.text} /></Section> -
Import it in
src/pages/index.astro, put<Awards class={column} />where it belongs, and raiselg:row-span-11to 12. -
To link it from the header, add
{ "label": "Awards", "href": "#awards" }tonavigationinsrc/content/site.json. 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.json:{"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/pages/about.astro, in the column the project and post pages use (it adds the footer under your<main>):---import PageColumn from "../components/site/PageColumn.astro";import about from "../content/pages/about.json";import { text } from "../design-system/tokens/text";import { cn } from "../design-system/utils/cn";import Layout from "../layouts/Layout.astro";---<Layout title={about.title} description={about.description}><PageColumn><main class="flex flex-col gap-5"><h1 class={cn(text.title, "text-light")}>{about.title}</h1><p class={cn(text.body, "text-white/80")}>{about.text}</p></main></PageColumn></Layout>Give every page one
<h1>. -
Link to it: add
{ "label": "About", "href": "/about" }tonavigationinsrc/content/site.json. -
Add
routes.aboutto thepathslist insrc/pages/sitemap.xml.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 file under src/pages/, its entry
in navigation, the route in routes.ts and its line in src/pages/sitemap.xml.ts. npm run check then tells you about
anything still using the route through routes.
Pages built from a collection
Section titled “Pages built from a collection”src/pages/project/[slug].astro builds one page per project:
export async function getStaticPaths() { return (await getProjects()).map((project) => ({ params: { slug: project.slug }, props: { project } }));}Add a project to src/content/collections/projects.json, and its page, its card and its sitemap entry appear on the next
build; any other address under /project/ is a 404. The posts work the same way (src/pages/blog/[slug].astro).
The 404 page
Section titled “The 404 page”src/pages/404.astro, with its copy in src/content/pages/not-found.json. It is built as 404.html, which hosts serve
for any unknown address, with a 404 status; it is 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 (
src/components/site/header.ts). - The links are
navigationinsrc/content/site.json, 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 (PageColumn.astro) 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 (CloseBar.astro). The close button leads back to the Home
section the visitor came from (close.href in project.json and post.json) and only it takes the pointer, so the strip
under it stays clickable.
The footer
Section titled “The footer”src/components/site/Footer.astro: 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.json; the newsletter box is described in Forms.
Search engines
Section titled “Search engines”- Sitemap:
src/pages/sitemap.xml.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/pages/robots.txt.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:urlfromLayout(withsrc/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. - 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).