# Folder settings

A folder's metadata.md says what the folder is, which game it is written for, and how everything inside it looks.

## The metadata file

Every folder can hold a `metadata.md`. Its frontmatter is the folder's settings. When you change a folder's icon, type or theme in the app, Dunjii writes this file. You can edit it by hand too.

```markdown
---
type: campaign
ruleset: draw-steel
theme: clean-lines
defaultType: npc
---
```

- `type: campaign`: This folder is a campaign. Its subfolders stay plain folders.
- `ruleset: draw-steel`: Every document under this folder is typed and checked as Draw Steel.
- `theme: clean-lines`: Every page under this folder prints in Clean Lines.
- `defaultType: npc`: An untyped document created in this folder, or in any folder under it, becomes an NPC.

Dunjii checks each value when it saves the file. A value it does not recognize is dropped, and the folder behaves as if the key were missing.

## Settings that apply to all subfolders

These keys apply to the folder and to every folder under it. A subfolder that sets the same key wins for itself and everything under it.

| Key            | What it does |
| -------------- | ------------ |
| `ruleset`      | The game the documents are written for: `5e-srd`, `draw-steel` or `pf2e`. Changing it retypes every document under the folder. |
| `theme`        | How pages look on screen and in print. |
| `defaultType`  | The type a new document or image takes when it does not declare one. |
| `footer`       | `false` turns off the footer you write. A license notice that a copied Sourcebook page needs still prints. |
| `footerPreset` | A ready-made footer line. |
| `footerText`   | Your own footer line. |
| `footerDunjii` | `false` takes the Dunjii credit off the footer. On the free plan the credit stays. |

The built-in themes:

| Theme | Value |
| --- | --- |
| Classic Parchment (Color) | `classic-parchment` |
| Clean Lines (B&W) | `clean-lines` |

The footer presets:

| Footer | Value |
| --- | --- |
| No notice | `none` |
| Unofficial Fan Content (Wizards of the Coast) | `wotc-fan-content` |
| SRD 5.2.1 attribution | `srd-attribution` |

## Settings for this folder only

| Key                    | What it does |
| ---------------------- | ------------ |
| `type`                 | `campaign` or `session`. This key alone makes a folder a campaign, a session. Leave it unset to keep it a plain folder. |
| `icon`                 | The icon beside the folder in the sidebar. Pick one in the app; it writes the key. |
| `navDisplayMode`       | `tree` opens the sidebar here as an expanding tree. `folder` opens one level at a time. Folders under this one follow it until one of them sets its own. Sessions default to `tree`. |
| `filterableProperties` | Only in the `metadata.md` at the top of your workspace. The frontmatter properties you can filter on in search. |

Note that some folder nestings are invalid. For example, putting a campaign inside a session, or a session inside another session, doesn't make sense and will fail validation.

## Type and defaultType

The two keys look alike but do different things. `type` says what the _folder_ is: a campaign, a session, or a plain folder. `defaultType` says what new things inside it become if a specific type is not set. A `Library/NPCs` folder with `defaultType: npc` makes every new document in it an NPC, and the folder itself stays a plain folder.

A document's own `type:` always beats the folder's `defaultType`. See [Document types](https://dunjii.com/docs/reference/document-types.md) for the values each game offers.
