Skip to content
Astro Rocket
Get in touch

Docs · Content

Projects

Adding a project, its fields, its page, and the projects on the homepage.

All docs pages

Projects are files in src/content/projects/<language>/. The file name is the address: src/content/projects/en/my-shop.md is /projects/my-shop/. The text under the fields is the project’s page.

The fields

The fields are described in src/config/collections.ts:

Field What it is
title The project’s name
description One sentence for the card, the page and search engines
category website, product or open-source
year The year
tone The colour of the drawn cover when there’s no picture: violet (the site’s colour), magenta or emerald
icon The icon above the name on the drawn cover: a Lucide name, or a brand mark such as brand-astro. Without it the category’s icon is used: a globe for a website, a package for a product, code for open source
tags Topics; each has its own page, /projects/tag/<tag>/
cover, coverAlt A picture for the card, in src/assets/, and what it shows
hero A picture for the project’s own page when it has no gallery
gallery Pictures and videos to swipe through beside the project’s title (see below)
client The client or owner, in the facts
services What was done, in the facts
url, repo The live site and the code: the two buttons under the title
urlLabel The words on the first button, such as View the demo; without it, the button says “Visit the site” in the site’s language
featured, order Featured projects come first, then by order, lower first
draft true keeps it off the site

A project’s page is built like a blog post, on the page’s own background: under the breadcrumbs comes the gallery, where a post has its cover, then the title, the facts and the buttons, then the text. Each slide is a picture in src/assets/ or a video in public/:

gallery:
  - src: ../../../assets/projects/my-shop-home.jpg
    alt: The shop's homepage
  - video: /videos/my-shop.mp4
    poster: ../../../assets/projects/my-shop-video.jpg
    alt: Ordering a product, from the basket to the payment
  • The paths of pictures and posters are relative to the project’s file; a video’s path starts at public/.
  • A visitor swipes, uses the arrows or the dots, or the arrow keys.
  • The first picture loads at once and the others when they’re needed. A video loads nothing until it’s played, shows its poster until then, and stops when the visitor swipes away.
  • One picture is shown whole at its own shape; several pictures and a video are shown at 16:9.
  • Without a gallery, the page shows the hero or cover picture, and without a picture, the drawn cover.

The demo’s Astro Rocket project has a gallery of four pictures: the homepage and the projects, in violet and in blue.

Where projects show

  • The homepage shows the first three, in one row.
  • /projects/ shows them all, three to a row and twelve to a page, with the tags above.
  • A project’s page shows its facts, its links, its gallery or cover, its text with a table of contents, and up to three more projects, three in a row.

projects: false in the settings removes all of it.