Skip to content
New: Customize your theme with an AI assistant. Read the guide

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/, and Arabic in arabic/, served under /ar/.

PageURLRoute (src/pages/[...lang]/)Content (src/content/)
Homepage/index.astrohomepage/english/-index.md and the section files
Demo homepages/home-two/, /home-three/, /home-four/home-two.astro, home-three.astro, home-four.astrohomepage/english/home-two.md, home-three.md, home-four.md
Services overview/services/services/index.astroservices/english/-index.md
Service page/services/<customSlug>/services/[single].astroservices/english/service-0X.mdx
Projects/projects/projects/index.astroprojects/english/-index.md
Project page/projects/<customSlug>/projects/[single].astroprojects/english/project-X.mdx
Pricing/pricing/pricing.astropricing/english/-index.md
Savings calculator/calculator/calculator.astrocalculator/english/-index.md
About/about/about.astroabout-us/english/-index.md
Team/team/team/index.astroteam/english/-index.md
Careers/careers/, /careers/<role>/careers/careers/english/
FAQ/faq/faq.astrofaq/english/-index.md
Blog/blog/, posts, /blog/page/<n>/, /blog/category/<name>/, /blog/tag/<name>/blog/blog/english/
Contact and quote/contact/contact.astrocontact/english/-index.md and sections/english/contact-section-two.md
Legal and text pages/privacy-policy/, /terms-conditions/[page].astropages/english/*.md
Shortcode demo/components/[page].astropages/english/components.mdx
404any missing URL404.astro (and src/pages/404.astro)notFound in src/i18n/en.json
RSS feed/rss.xmlrss.xml.tsbuilt from the blog posts

Each collection (services, projects, careers, blog, team, testimonials) is explained in Collections.

Inner pages such as pricing, the calculator, contact, FAQ, team, careers, projects, and blog start with a page header: a small badge, the title, and a description. It is set by fields at the top of the page’s content file:

src/content/careers/english/-index.md
badge: "Careers"
title: "Build the clean energy around you"
description: "We hire installers, electricians, and advisors who take pride in tidy work..."
headerImage: "/images/photos/cta-unsplash-pIcseKMisrs.jpg" # optional photo under the header
headerImageAlt: "Two installers fitting solar panels on a roof"
headerAlign: "left" # left | center

The about page and the services overview open with a section instead (the about intro, and the services band).

Service and project pages show the entry’s title in the header. Their badge comes from badgeSecondary in services/english/-index.md and from the project’s first category, and a project’s header photo is its image.

Fields Every Page Accepts

These frontmatter fields work on page and entry files. src/content/_file_format.md explains most of them; the full list is the page schema in src/content.config.ts.

FieldWhat it does
title, descriptionThe page title and summary
badgeThe small label above the title in the page header
metaTitle, metaDescriptionReplace the title and description in search results only
imageSocial preview image for this page (and the photo on cards, for entries)
drafttrue hides the page from the built site (it still shows in npm run dev)
customSlugA different URL segment than the file name. Use the same value in every language
canonical, robots, keywordsSEO overrides
excludeFromSitemap, excludeFromAiLeave the page out of the sitemap, or out of llms.txt and the Markdown copies
disableTaglineDon’t add the site tagline to this page’s title
footerLayoutwordmark, newsletter, cta, or contact: another footer on this page. See Footer
headerLayoutclassic, transparent, floating, or promo: another header on this page. See Header
headerAnnouncementThe announcement strip text on this page (Markdown)
date, updatedPublish date and last meaningful edit, used in structured data

Add A Page

For policies, guides, or any page of text. Ecozen renders every file in src/content/pages/ as a page.

  1. Copy src/content/pages/english/terms-conditions.md to a new file, for example src/content/pages/english/warranty.md. The file name becomes the URL: /warranty/.

  2. Change title, description, date, and the Markdown body.

  3. Create a version in each other language folder of src/content/pages/ with the same file name.

  4. Add a link to it in every src/config/menu.*.json file, for example in footerSecondary.

Remove A Page

  1. Delete its route file in src/pages/[...lang]/ and its content (file or folder) in src/content/, in every language.
  2. Remove its links from every src/config/menu.*.json file and any content file or button that links to it (search the project for the URL).
  3. Run npm run astro-check, then npm run build, to make sure nothing still points to it.

To hide a page without deleting it, set draft: true in its content file.

Type something to search...