Skip to main content
The projects collection stores information about your portfolio projects. Each project is defined as an MDX file in src/content/projects/ with frontmatter that conforms to the project schema.

Schema Definition

The project schema is defined in src/content/config.ts using Zod validation.

Fields

title
string
required
The title of your project. This will be displayed as the main heading on project cards and detail pages.
startDate
date
required
The start date of the project in YYYY-MM-DD format. Used for sorting and displaying project timeline.Example: 2025-03-16
description
string
required
A brief description of the project. This appears on project cards and is used for SEO metadata.
image
object
Optional image object for the project thumbnail or hero image.
image.url
string
required
The URL or path to the image file. Can be a relative path from the public/ directory.Example: /portfolio.png
image.alt
string
required
Alternative text for the image, used for accessibility and SEO.
tags
string[]
Optional array of tags or technologies used in the project. Useful for filtering and categorization.Example: ["Astro", "Shadcn UI", "Tailwind CSS"]

Example Project File

Here’s a complete example of a project MDX file:
src/content/projects/portfolio.mdx
---
slug: "portfolio"
title: "Portfolio"
description: "My portfolio website. You are viewing this only."
startDate: 2025-03-16
image: { url: "/portfolio.png", alt: "Portfolio" }
tags: ["Astro", "Shadcn UI", "Tailwind CSS"]
---

# Portfolio

This is my portfolio website built with Astro. It showcases my projects and skills.
You are viewing this only.

Field Requirements

FieldTypeRequiredDefault
titlestringYes-
startDatedateYes-
descriptionstringYes-
imageobjectNoundefined
image.urlstringYes (if image provided)-
image.altstringYes (if image provided)-
tagsstring[]Noundefined

Usage Notes

  • The slug field in frontmatter is used for routing but is not part of the schema validation
  • Dates must be in ISO format (YYYY-MM-DD)
  • Images should be placed in the public/ directory and referenced with a leading slash
  • Tags are case-sensitive and will be displayed exactly as entered
  • The MDX body content after frontmatter can include any valid MDX, including components and markdown

Build docs developers (and LLMs) love