CarrGo Astro documentation

Pages and blocks

Build any page from CarrGo's 22 blocks by copying snippets from the block library.

Every page in CarrGo is a list of blocks: a hero, a fares table, a fleet section, a call to action and so on. You build a page by listing blocks in its file, and you change a page by reordering, removing or editing them.

The block library

Open /blocks/ on the demo, or on your own copy while npm run dev is running. It shows all 50 variants live. Each one has:

  • Copy snippet, which copies the block’s settings, ready to paste
  • Show YAML, which shows the same settings
  • Copy link, which copies a link straight to that block

Make a page

Create a file in src/content/pages/. The file name becomes the address: airport.md is /airport/.

---
title: Airport transfers
description: Fixed fares to every airport, flight tracking and meet and greet.
sections:
  - type: page-header
    variant: image
    title: Meet and greet at every terminal
    image: service-airport.jpg
  - type: fares
    variant: split
    groups: [Airports]
  - type: booking
    variant: card
    form: quick
---
  • title is the page title in the browser tab and in search results.
  • description is the text under it in search results.
  • image (optional) is the picture shown when the page is shared.
  • noindex: true keeps a page out of search results.

Anything you write below the closing --- appears after the blocks in a reading column. The privacy and terms pages work this way.

The blocks

Group Blocks
Openers hero (booking, photo, split, centered) and page-header (simple, image)
Booking and fares booking (panel, card) and fares (estimator, table, split)
Services and fleet services (icons, images, list) and fleet (cards, compare)
Riders and drivers app (mockup, band), earnings (split, card), packages (tiers, hourly)
Trust stats (row, cards), feature (split, grid, checklist), reviews (summary, cards, quote), logos (badges, row)
Places cities (cards, list) and map (wide, split)
Content posts (featured, grid), faq (split, stacked), team (grid, compact), text (split, narrow)
Contact and calls to action contact (split, cards), steps (row, timeline), cta (band, split)

Settings every block takes

Setting What it does
tone The background: default, paper, cream, route, taxi (bright yellow) or night (dark in both modes).
space normal, small or none: the space above and below.
id An anchor, so you can link to the block with /page/#your-id.

Many blocks also take a heading with eyebrow (the small label), title, text and align (start or center).

Formatting in titles and short text

Write To get
**bold** bold
*italic* italic
==highlight== a word on a yellow highlight
[a link](/fares/) a link

When something’s wrong

Every page is checked when you save. If a setting is misspelt or a variant doesn’t exist, the preview shows an error that names the file and the setting, such as sections.2.variant. That means the third block, because counting starts at 0.