directory
A simple records listing — a faculty directory, an alumni list, an item catalog. Pinned to @unipress/data. Outputs an Excel workbook (one sheet, one row per record) or a Word listing.
Scaffold
unipress create faculty --template directory --title "Faculty Directory" --author "Dean's Office"
cd faculty
unipress compile . --format xlsx --out faculty.xlsxWhat you get
faculty/
├── document.yml pinned to @unipress/data@<version>; one queryable query
├── records/
│ └── members/ three sample records
└── content/
└── directory/ cover (Loom-rendered count) + listingdocument.yml fields
| Field | Purpose |
|---|---|
name | Workbook title. |
format | xlsx (default) or docx. |
index | Routes / → content/directory. |
queries.members | The query over the records in records/members/. |
queries.members.queryable | Filterable fields — drives the FilterPanel UI. |
Add an entry
Drop a YAML file under records/members/. Filename (stem) becomes the slug:
# records/members/your-name.yml
name: "Your Name"
role: member # or lead / advisor
department: sciences # or engineering / humanities
active: true
email: you@example.org
joined_year: 2024Adjust the queryable fields
The fields exposed in the FilterPanel UI come from document.yml's collections.members.queryable: block. Each field becomes a control:
enum→ multi-select dropdown.boolean→ toggle.range→ numeric range input.text→ search box (substring match).
Add a joined_year: range field, for example, if filtering by start year matters for your directory.
Hand-pick the displayed columns
The Members section reads every key from each record by default. To restrict the columns shown in the web preview and the xlsx export, set columns: on the section frontmatter in content/directory/members.md.
When to pick directory over data-report
- The data is one flat collection of records (faculty, members, alumni, items).
- You want a single listing, not aggregate metrics broken out by axis.
- Filterability + a tabular export is the entire point.
For multi-section aggregate reports (publications-by-year, funding totals, supervision counts), use data-report.
Foundation reference
@unipress/data — see the foundation's README: framework/unipress/foundations/data/README.md.