Pages
Skill level: Beginner to edit, light code to add a page made of sections
Every Page And Its File
The route file decides which sections a page shows. The content file holds the page’s title, SEO fields, page header, and named blocks. Paths below are for English; French uses the same files in french/, served under /fr/.
| Page | URL | Route (src/pages/[...lang]/) | Content (src/content/) |
|---|---|---|---|
| Main homepage | / | index.astro | homepage/english/-index.md |
| Corporate consulting | /corporate-consulting/ | corporate-consulting.astro | homepage/english/corporate-consulting.md |
| Tax and accounting | /tax-accounting/ | tax-accounting.astro | homepage/english/tax-accounting.md |
| One-page homepages | /landing/home/, /landing/corporate-consulting/, /landing/tax-accounting/ | landing/ | Same as the homepages above |
| About | /about/ | about/index.astro | about/english/-index.md |
| About, style 2 | /about/style-02/ | about/style-02.astro | faq/english/-index.md (faqSection) |
| Company | /company/ | company.astro | sections/english/company-page.md |
| Awards | /awards/ | awards.astro | awards/english/-index.md |
| People | /people/, /people/<name>/ | people/ | people/english/ |
| Careers | /careers/, /careers/<role>/ | careers/ | careers/english/ |
| Solutions | /solutions/, /solutions/<solution>/ | solutions/index.astro, solutions/[single].astro | solutions/english/ |
| Solution layouts | /solutions/style-01/, /solutions/style-02/ | solutions/ | solution-style-01/, solution-style-02/ |
| Industries | /industries/, /industries/<industry>/ | industries/index.astro, industries/[single].astro | industries/english/ |
| Industry layouts | /industries/style-01/, /industries/style-02/ | industries/ | industry-style-01/, industry-style-02/ |
| Portfolio | /portfolio/, /portfolio/<project>/, /portfolio/category/<name>/ | portfolio/ | portfolio/english/ |
| Case studies | /case-study/, /case-study/<case>/ | case-study/ | case-study-page/english/ |
| Blog | /blog/, /blog/standard/, /blog/style-01/, /blog/style-02/, posts, /blog/category/<name>/, /blog/tag/<name>/, /blog/rss.xml | blog/ | blog/english/, authors in author/english/ |
| Pricing | /pricing/ | pricing.astro | pricing/english/-index.md |
| FAQ | /faq/ | faq.astro | faq/english/-index.md |
| Contact | /contact/ | contact.astro | contact/english/-index.md |
| Webinar and event | /webinar-event/ | webinar-event.astro | pages/english/webinar-event.md |
| Search | /search/ | search.astro | sections/english/search-section.md |
| Privacy policy, terms | /privacy-policy/, /terms-conditions/ | [page].astro | pages/english/privacy-policy.md, terms-conditions.md |
| Shortcode demo | /components/ | [page].astro | pages/english/components.mdx |
| 404 | any missing URL | src/pages/404.astro, src/pages/[lang]/404.astro | notFound in src/i18n/en.json |
Each collection (solutions, people, blog, and the others) is explained in Collections.
The Page Header
Inner pages start with a page header: breadcrumb, title, and description, often over a background image. It reads the page’s own fields:
title: "Pricing Plan"description: "..."image: "/images/contact/breadcrumb-bg6.webp" # background imagebreadcrumbLabel: "Pricing" # breadcrumb text, where the page uses ittitle and description accept <br /> for a line break. The same image is used as the page’s social preview image.
Fields Every Page Accepts
These frontmatter fields work on page and entry files. src/content/_file_format.md explains each one; the full list is the page schema in src/content.config.ts.
| Field | What it does |
|---|---|
title, description | The page title and summary |
metaTitle, metaDescription | Replace the title and description in search results only |
image | Social preview image (and header background where the page has one) |
draft | true hides the page from the built site (it still shows in npm run dev). On a -index.md, it hides the whole collection |
customSlug | A different URL segment than the file name. Use the same value in every language |
canonical, robots, keywords | SEO overrides |
excludeFromSitemap | Leaves the page out of the sitemap |
excludeFromCollection | Leaves an entry out of the results of the /search/ page |
excludeFromAi | Leaves the page out of llms.txt and its Markdown copy |
disableTagline | Don’t add the site tagline to this page’s title |
weight | Sort order in lists (lower numbers first) |
Add A Page
For a policy, a guide, or any page of text. Every file in src/content/pages/ becomes a page.
-
Create a new file, for example
src/content/pages/english/our-approach.md. The file name becomes the URL:/our-approach/. -
Add a
title, adescription, and the Markdown body:---title: "Our approach"description: "How we work with clients, from first call to final report."---## How we startText of the page... -
Create the French version in
src/content/pages/french/with the same file name. -
Add a link to it in
src/config/menu.en.jsonandmenu.fr.json.
A text page shows the page header, the body, and the features and call to action sections (featuresSection and ctaSection blocks). For a legal page in the style of the privacy policy, copy privacy-policy.md: its legalPage block holds the sections, the “last updated” line, and the contact box.
For a landing page that reuses Consultiz’s sections.
-
Copy a route with a similar structure, for example
src/pages/[...lang]/pricing.astro, tosrc/pages/[...lang]/advisory.astro. The file name becomes the URL:/advisory/. -
Make it read its own content file. Change
getEntryCTM("pricing", "-index", ...)togetEntryCTM("pages", "advisory", Astro.currentLocale), and createsrc/content/pages/english/advisory.mdwith atitleand the named blocks you need. -
Stop the text-page route from building the same file: in
src/pages/[...lang]/[page].astro, filter outadvisorythe waywebinar-eventis filtered out. -
Replace the sections inside
<Base>with the ones you want, and pass each its block, for example<FaqCentered content={entry?.data?.corporateFaq} />. Use block names fromsectionsSchemainsrc/sections.schema.ts. -
Create the French content file and add the page to the menus.
Section 6 of NEXTJS-TO-ASTRO-GUIDE.md in the theme walks through the same steps with full code.
Remove A Page
- Delete its route file in
src/pages/[...lang]/and its content (file or folder) insrc/content/, in every language. - Remove its links from
src/config/menu.en.json,menu.fr.json,src/content/sections/*/footer-newsletter-grid.md, and any content file that links to it (search the project for the URL). - Run
npm run astro-check, thennpm run build, to make sure nothing still points to it.
To hide a page without deleting it, set draft: true in its content file.