# Pages

## 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](/consultiz/customization/collections/).

<Aside type="note" title="There are no service pages">
  Services are solutions: each one is a file in `src/content/solutions/` with
  its page at `/solutions/<solution>/`. The old `/services/` URLs redirect to
  `/solutions/` (see `astro.config.mjs`).
</Aside>

### 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:

```yaml
# src/content/pricing/english/-index.md
title: "Pricing Plan"
description: "..."
image: "/images/contact/breadcrumb-bg6.webp"   # background image
breadcrumbLabel: "Pricing"                      # breadcrumb text, where the page uses it
```

`title` 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
<Tabs>
  <TabItem label="A text page (no code)">

    For a policy, a guide, or any page of text. Every file in `src/content/pages/` becomes a page.

    <Steps>

    1. Create a new file, for example `src/content/pages/english/our-approach.md`. The file name becomes the URL: `/our-approach/`.

    2. Add a `title`, a `description`, and the Markdown body:

       ```md
       ---
       title: "Our approach"
       description: "How we work with clients, from first call to final report."
       ---

       ## How we start

       Text of the page...
       ```

    3. Create the French version in `src/content/pages/french/` with the **same file name**.

    4. Add a link to it in `src/config/menu.en.json` and `menu.fr.json`.

    </Steps>

    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.

  </TabItem>
  <TabItem label="A page made of sections (light code)">

    For a landing page that reuses Consultiz's sections.

    <Steps>

    1. Copy a route with a similar structure, for example `src/pages/[...lang]/pricing.astro`, to `src/pages/[...lang]/advisory.astro`. The file name becomes the URL: `/advisory/`.

    2. Make it read its own content file. Change `getEntryCTM("pricing", "-index", ...)` to `getEntryCTM("pages", "advisory", Astro.currentLocale)`, and create `src/content/pages/english/advisory.md` with a `title` and the named blocks you need.

    3. Stop the text-page route from building the same file: in `src/pages/[...lang]/[page].astro`, filter out `advisory` the way `webinar-event` is filtered out.

    4. 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 from `sectionsSchema` in `src/sections.schema.ts`.

    5. Create the French content file and add the page to the menus.

    </Steps>

    Section 6 of `NEXTJS-TO-ASTRO-GUIDE.md` in the theme walks through the same steps with full code.

  </TabItem>
</Tabs>

### 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 `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).
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.

<Aside type="note">
  The main and corporate consulting homepages (and their `/landing/`
  versions) don't read `draft`. To remove one, delete its files. `astro.config.mjs` also redirects a few old
  demo addresses (such as `/home-two/` and `/our-people/`) to their current
  pages; remove entries from `legacyRoutes` there if you don't need them.
</Aside>