# Examples

> A starter example with the theme pre-configured --- copy it and start building.

The quickest way to get started is to copy the starter example in the
`examples/` directory. It's a self-contained Astro project with the theme
pre-configured, a GitHub Pages deploy workflow, and example content you can
replace with your own.

## Quick start

Clone the repository and copy the example into a new directory:

```bash
git clone https://github.com/ANUcybernetics/astro-theme-university.git
cp -r astro-theme-university/examples/base my-site
cd my-site
pnpm install
pnpm dev
```

The example pins the theme to the release it shipped with. To move to a newer
release later, change the tag in `package.json` and run `pnpm install`.

## What's in the base example

A minimal themed site with a single `pages` content collection. Good for project
sites, research group pages, and general content.

Includes:

- `PageLayout` for MDX pages with optional hero images
- a `pages` content collection for markdown/MDX pages
- `site-config.ts` for site name, navigation, favicon, and licence
- a `mise.toml` naming the Node and pnpm versions, so `mise install` sets up a
  matching toolchain
- a GitHub Actions workflow that builds and deploys to GitHub Pages

## Deployment

Push the copied site to a GitHub repository, enable GitHub Pages with "GitHub
Actions" as the source, and every push to `main` builds and deploys. The
workflow derives `SITE_URL` and `BASE_PATH` from the repository name, so a
project site lands at `https://<owner>.github.io/<repo>/` with every internal
link carrying the `/<repo>/` prefix. For another host, or a GitLab Pages
instance, set the two variables to match and see
[deploying](https://anucybernetics.github.io/astro-theme-university/docs/guides/deploying/).

## Course websites

A course site is the same starter plus
[astro-course-university](https://github.com/ANUcybernetics/astro-course-university),
which adds the content model (topics, labs, assessments, people), a build-time
check that every cross-reference resolves, and a generated JSON API. See the
[brand packages and course sites](https://anucybernetics.github.io/astro-theme-university/docs/guides/brand-packages/) guide.

## Next steps

Once you have the example running, edit `src/site-config.ts` to set your site
name and navigation links. See
[configuration](https://anucybernetics.github.io/astro-theme-university/docs/getting-started/configuration/) for details on all the
available options.
