---
title: Site data
description: Navigation, footer and settings stored in one JSON, YAML or TOML file.
---

Collections with Astro's `file()` loader show up as **Site data**. One file holds them:

- A plain array or a keyed object is a list of entries.
- Parsers like `(t) => JSON.parse(t).part` or `(t) => ({ id: JSON.parse(t).part })` edit one part of the file. The site's own parse calls work too (`yaml.load`, smol-toml `parse`).
- A `glob()` of one named file (`pattern: 'settings.yaml'`) is one settings object, in any format, without a parser.

```ts src/content.config.ts
const settings = defineCollection({
  loader: glob({ base: "./src/data", pattern: "settings.yaml" }),
  schema: z.object({ siteName: z.string(), phone: z.string().optional() }),
});

const nav = defineCollection({
  loader: file("./src/data/nav.json"),
  schema: z.object({ label: z.string(), href: z.string() }),
});
```

:::note
Custom parsers stay read-only. To add a new list to a shared YAML/TOML file, give the list its own file instead.
:::
