Polaris Astro documentation

Pages and blocks

Build any page from Polaris's 31 blocks by copying snippets from the block library, and change the detail page layouts.

Every page in Polaris is a list of blocks: a hero, a trip finder, an itinerary, a list of reviews. You choose the blocks and their order in the page’s file, and change the words. There’s no page builder to learn and nothing to install.

The block library

Open /blocks/ on the demo, or on your own site while npm run dev is running. It shows all 31 blocks in their variants, live, each with a snippet you can copy.

Adding a block to a page

Pages live in src/content/pages/. Open one, find sections:, and paste the snippet as a new item:

---
title: All trips
description: Every trip in one list. Filter by region, month, trail grade and length.
search: false
sections:
  - type: page-header
    variant: simple
    title: Find your *trail*
    lead: Treks, road trips and family walks, each one walked by our team before it went on sale.

  - type: finder
    variant: trips

  - type: steps
    variant: row
    heading:
      index: 2
      mark: How it works
      title: Four steps to the *trailhead*
    items:
      - title: Tell us your plan
        text: Send a request with dates, who is coming and what you like. Nothing to pay.
      - title: Get a first route
        text: A planner replies within one working day.

  - type: cta
    variant: band
---

Indentation matters in YAML: each block starts with - type: at the same depth, and its settings sit two spaces further in. If something is wrong, npm run dev names the page and the field.

Any Markdown written below the closing --- is shown after the blocks in a reading column, which is handy for privacy and terms pages.

Making a new page

Create a file, such as src/content/pages/groups.md, with a title and sections:. It’s published at /groups/. Add it to the menu in src/site.config.ts.

Page settings

These go in the page’s front matter, above sections::

Setting What it does
title The page title. Required.
description The page description for search engines, up to 170 characters.
image A share image for this page, as a file name in src/assets/images/. Defaults to shareImage in site.config.ts.
noindex true asks search engines to skip the page, and leaves it out of the sitemap and of site search. Default false.
search false keeps the page out of site search. Default true. See Search.
header auto (the default), solid or overlay. auto makes the header transparent over the photo when the page opens with a photo hero.
sections The list of blocks.

Settings every block has

Setting What it does
type Which block it is.
variant Which layout of that block. The library shows every variant.
tone The section’s background: default, mist, sand, dawn, pine or night. pine and night are dark, and the text switches to light automatically.
space Space above and below: default, tight, none-top or none-bottom.
contours true draws faint contour lines behind the section. Default false.
id An anchor name, so you can link to the section: id: dates makes #dates. Lowercase letters, numbers and dashes.

Alternate tones down a page so each section stands apart.

The chapter heading

Most blocks take a heading, which draws the small numbered label and the large title above the block. It shows when you set a title or a mark:

heading:
  index: 2
  mark: How it works
  title: Four steps to the *trailhead*
  lead: A sentence under the title.
  link:
    label: All trips
    href: /trips/

index is the chapter number (shown as 02), mark is the small label, title is the headline, lead is an optional line, and link adds a “view all” link. Write a word between asterisks to set it in italics.

Buttons

Blocks that take actions accept up to three buttons, each with a label, an href, a style (primary, accent, ghost, on-photo or link) and an optional icon, which can be any Lucide icon name.

The blocks

Blocks are grouped as in the library. Every block also takes the settings above, and a heading unless noted. Settings that name a trip, stay or destination take its file name without .md.

Openers

Block Variants Key settings
hero search, photo, split title, lead, meta (the small coordinates line), image, imageAlt, imagePosition, actions. split also takes image2, image2Alt and up to four stats. search takes a search object. No heading.
search panel, bar action (default /trips/), types (trips, stays, camping), button.

Discover

Block Variants Key settings
finder trips, stays destination, stayType, empty. A full list with filters.
destinations postcards, rail, atlas items, featured, limit.
trips cards, list, featured items, destination, featured, exclude, limit.
stays cards, list items, destination, stayType, featured, exclude, limit.
season table, single destinations (table), destination or months and notes (single), legend.
journal grid, featured, list tag, destination, featured, limit.

Convert

Block Variants Key settings
cta band, split actions, contacts (whatsapp, phone, email), and for split image, alt, position.
steps row, route items (2 to 5, each with title and text), actions.
enquiry panel, split preset, contacts, steps. See Enquiries.
faq stacked, split items (each q and a), trip, open, contact, jsonld.
contact split, cards form, preset, hours, office.

Trust

Block Variants Key settings
stats row, band items (2 to 4, each value and label), claim (band).
features grid, split items (2 to 6, each icon, title, text), actions, and for split image, alt, position.
reviews cards, summary, quote trip, stay, featured, limit.
hosts grid, row items, destination, limit, label (row).
partners logos, badges logos (2 to 10) or badges (2 to 6).

Content

Block Variants Key settings
text prose, columns body (Markdown).

Detail

These blocks build the trip, stay and destination pages. You can also use them on any page by naming the entry.

Block Variants Key settings
page-header simple, photo, trip title, lead, atlas, breadcrumbs, image, imageAlt, imagePosition, trip. No heading.
overview facts, split trip or stay. split includes the booking box.
itinerary route, compact trip, peak, open.
tiers cards, table trip, tiers, highlight, rows.
inclusions split, list trip, included, excluded.
departures table, cards trip, limit.
rooms list, cards stay, items.
amenities grid, trust stay, items, meals, rules, trust, facts, note.
gallery mosaic, strip trip, stay, images.
map wide, split stay, destination, coords, name, altitude, embed, link, radius, address, gettingThere, airport.
glance grid, band destination, glance.
notes list, banner destination, kind, items.

The names in the Detail group are the settings that fill a block from a content file. The trip, stay and destination pages pass them for you. On any other page, name the entry yourself, for example trip: markha-valley-trek.

Detail page layouts

The pages for destinations, trips, stays and journal posts are lists of blocks too. Edit them in src/lib/details.ts, in the functions destinationPage(), tripPage(), stayPage() and postPage(). Reorder, remove or add any block, and the build checks your list against the block settings.

Page Blocks, in order
Destination page-header (photo), notes (banner, only if a note is closed), glance, trips, season (single), stays, notes (list), journal, cta
Trip page-header (trip), overview (split), itinerary, tiers, inclusions, departures, hosts (row), reviews (summary), faq, trips
Stay page-header (simple), gallery (mosaic), overview (split), rooms, amenities (grid), amenities (trust), map (split), reviews, stays
Journal post page-header (photo), the post’s Markdown, then journal and cta

On a trip page, itinerary, tiers, inclusions, departures and faq only appear when the trip file has that data. On a stay page, rooms only appears when the stay has rooms.

The map block

The map loads nothing from a map service until a visitor clicks Show map. By default it uses OpenStreetMap. To use another service, set embed to its https:// embed address and link to the “open larger map” address.