# Options

> Every option of jaad.config.ts, with its type and default.

Every option lives in `jaad.config.ts`, at the project root. Only `title` is
required:

```ts
import { defineJaadConfig } from '@jaamd/jaad'

export default defineJaadConfig({
    title: 'My Project',
    site: 'https://example.dev',
})
```

## The docs' own

| Option                                                                    | Type                | Default    | What it does                         |
| ------------------------------------------------------------------------- | ------------------- | ---------- | ------------------------------------ |
| [`docsDir`](https://docs.jaamd.org/jaad/configuration/docsdir.md)         | `string`            | `"./docs"` | The directory of the pages           |
| [`routeBase`](https://docs.jaamd.org/jaad/configuration/routebase.md)     | `string`            | `"/"`      | Where the docs are served            |
| [`sections`](https://docs.jaamd.org/jaad/configuration/sections.md)       | `object`            | none       | One directory per part of the docs   |
| [`locales`](https://docs.jaamd.org/jaad/configuration/locales.md)         | `string[] \| false` | detected   | The language directories             |
| [`readingTime`](https://docs.jaamd.org/jaad/configuration/readingtime.md) | `boolean`           | `false`    | The minutes to read a page           |
| [`editLink`](https://docs.jaamd.org/jaad/configuration/editlink.md)       | `boolean \| string` | `true`     | The "Edit this page" link            |
| [`author`](https://docs.jaamd.org/jaad/configuration/author.md)           | `string`            | none       | The author of a page that names none |
| [`llms`](https://docs.jaamd.org/jaad/configuration/llms.md)               | `boolean`           | `true`     | Files for language models            |

## Site options

[JAAB](https://docs.jaamd.org/jaab) reads these too. Beside it, they go in
`site.config.ts`, shared by both: see
[Docs and a blog](https://docs.jaamd.org/jaab/getting-started/installation#docs-and-a-blog).

| Option                                                                    | Type               | Default         | What it does                          |
| ------------------------------------------------------------------------- | ------------------ | --------------- | ------------------------------------- |
| [`title`](https://docs.jaamd.org/jaad/configuration/title.md)             | `string`           | required        | The site name                         |
| [`description`](https://docs.jaamd.org/jaad/configuration/description.md) | `string`           | `package.json`  | The site description                  |
| [`lang`](https://docs.jaamd.org/jaad/configuration/lang.md)               | `string`           | `"en"`          | The language, the default one if many |
| [`logo`](https://docs.jaamd.org/jaad/configuration/logo.md)               | `string`           | none            | An image in place of the site name    |
| [`homeLink`](https://docs.jaamd.org/jaad/configuration/homelink.md)       | `string`           | `"/"`           | Where the site name leads             |
| [`nav`](https://docs.jaamd.org/jaad/configuration/nav.md)                 | `object[]`         | `[]`            | Text links in the header              |
| [`social`](https://docs.jaamd.org/jaad/configuration/social.md)           | `object`           | from git        | Icon links in the header              |
| [`footer`](https://docs.jaamd.org/jaad/configuration/footer.md)           | `string \| false`  | credit, `:feed` | The footer                            |
| [`authors`](https://docs.jaamd.org/jaad/configuration/authors.md)         | `object`           | `{}`            | The people who write the site         |
| [`head`](https://docs.jaamd.org/jaad/configuration/head.md)               | `object[]`         | `[]`            | Extra tags in `<head>`                |
| [`ogImage`](https://docs.jaamd.org/jaad/configuration/ogimage.md)         | `string \| false`  | detected        | The social image                      |
| [`theme`](https://docs.jaamd.org/jaad/configuration/theme.md)             | `string \| object` | `"default"`     | The colours of the interface and code |
| [`appearance`](https://docs.jaamd.org/jaad/configuration/appearance.md)   | `string`           | `"auto"`        | Light, dark, or the reader's choice   |
| [`tailwind`](https://docs.jaamd.org/jaad/configuration/tailwind.md)       | `boolean`          | `false`         | Tailwind in your pages and styles     |
| [`ui`](https://docs.jaamd.org/jaad/configuration/ui.md)                   | `object`           | `{}`            | The interface strings, per language   |

## Astro options

[`site`](https://docs.jaamd.org/jaad/configuration/site.md), the public URL, [`base`](https://docs.jaamd.org/jaad/configuration/base.md), the path the site
is served below, and [`astro`](https://docs.jaamd.org/jaad/configuration/astro.md), Astro options of your own, set up
Astro. With `@jaamd/jaad/site`, they go in `jaad.config.ts`. In an
`astro.config` of your own, as beside JAAB, `site` and `base` go in its
`defineConfig`, with the rest of Astro's own options, and of `astro` only
`fonts` is read: see
[Existing Astro project](https://docs.jaamd.org/jaad/getting-started/installation.md#existing-astro-project).

## Found in the project

Some values need no option. JAAD reads them from the project:

| Value                        | Read from                                         |
| ---------------------------- | ------------------------------------------------- |
| Repository and edit links    | the git remote and the branch                     |
| Description, when not set    | `package.json`                                    |
| Favicon                      | `public/favicon.svg`, `.ico` or `.png`            |
| Social image, when not set   | `public/og-image.png`, `.jpg`, `.jpeg` or `.webp` |
| Styles of your own           | `src/jaamd.css`                                   |
| Languages                    | the directory names under `docsDir`               |
| Trailing slash of page links | Astro's `trailingSlash` and `build.format`        |

## Errors

An unknown key stops the build at any depth, and names its path: a misspelt
`attributes` in a `head` entry is caught like a misspelt `titel`. Links in
`nav`, `social` and `homeLink` are paths or `http(s)`, `mailto` and `tel` URLs.
