Lyra Astro documentation

Causes and campaigns

Describe your programmes, and run fundraising campaigns with a goal, progress bar and deadline.

Causes are the lasting areas of your work, such as clean water, education or health. Campaigns are fundraising appeals with a goal and usually a deadline, such as a winter appeal. A campaign can belong to a cause.

Both are Markdown files, one per cause or campaign, in a folder per language. The file name becomes the address: src/content/causes/en/clean-water.md is published at /causes/clean-water/, and its Spanish version, src/content/causes/es/clean-water.md, at /es/causes/clean-water/.

Causes

---
title: Clean water
summary: Wells, filters and hygiene training so families stop walking hours for water that makes them sick.
color: water
icon: droplets
image: water-well.jpg
imageAlt: A girl washing her face at a village tap
stats:
  - { value: "312", label: wells built }
  - { value: "86,000", label: people served }
order: 1
---

Every well we build is chosen, dug and looked after by the village itself.
Field What it does
title, summary The cause’s name and one or two sentences about it, used on cards and at the top of its page.
color The cause’s colour on cards and tags: water (blue), education (yellow), health (pink), brand or accent.
icon Any Lucide icon name, shown on the card.
image, imageAlt The photo, as a file name in src/assets/images/, and a short description of it for screen readers.
imagePosition Optional. Which part of the photo to keep when the page header crops it: top, center, bottom, or a value such as 50% 30%.
stats Up to three numbers shown on the card and the page.
order The position in lists. Lower numbers come first.

The text below the front matter is the body of the cause’s page. Lyra adds the cause’s numbers, its latest stories and a donation form under it.

Campaigns

---
title: Water before the dry season
summary: Twelve new wells for Kisumu county before the rains stop in January.
cause: clean-water
goal: 50000
raised: 32400
donors: 412
deadline: 2026-12-31
image: winter-appeal.jpg
imageAlt: Children by a water pump in a village
featured: true
---
Field What it does
title, summary, image, imageAlt As for causes.
cause Optional. The file name of the cause this campaign belongs to, such as clean-water.
goal The target amount, as a plain number with no currency sign or commas.
raised The amount raised so far. Update it as donations come in, and rebuild.
donors Optional. The number of donors, shown under the progress bar.
deadline Optional. The last day of the campaign, as YYYY-MM-DD.
featured true makes this the campaign shown by blocks that don’t name one.

The currency comes from donate.currency in site.config.ts, and amounts are written the way each language expects: $32,400 in English and 32.400 $ in Spanish.

Days left, funded and ended

The “days left” count is worked out in the visitor’s browser, so it stays correct every day without a rebuild. A campaign whose raised reaches its goal shows Funded, and one past its deadline shows Campaign ended. Lists always show open campaigns first, soonest deadline first.

Showing a campaign

  • The campaign block, highlight variant, shows one campaign large with its progress and the donation form. Set campaign: winter-appeal to choose it, or leave it out to use the featured one.
  • The campaign block, cards variant, lists campaigns with progress bars.
  • The hero block, campaign variant, opens a page with a campaign.
  • Each campaign has its own page at /campaigns/<file-name>/: the campaign and its progress at the top, the text from its file, then a donation form.

When someone gives through a campaign’s form, the campaign’s file name is sent to your donation provider as campaign, so you can tell appeals apart in its reports if it records extra link values.