Display custom recipe metadata (e.g. nutrition) on the recipe page
- Dominant language
- Rust
- Stars
- 1.4k
- Forks
- 109
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 19
Description
## Problem
Cooklang's YAML frontmatter supports arbitrary custom metadata keys beyond the [standard ones](https://cooklang.org/docs/spec/#canonical-metadata) (`servings`, `time`, `course`, ...), but CookCLI's web UI only shows a handful of known fields as pills, plus flat scalar custom fields as `key: value` pills. There's no good way to show structured custom metadata — the most common example being nutrition facts (calories, protein, fat, ...) that many recipe collections carry per recipe.
## Proposal
Any non-standard YAML key whose value is a **list** or a **mapping** should render as its own line on the recipe page, below the tags — one line per "family":
```yaml
nutrition:
kcal: 234
proteins: 9.8
lipids: 17.6
allergens:
- gluten
- tree nuts
```
- Works generically for any such key with no code changes — `allergens:` above should just work.
- A couple of well-known families (`nutrition`, and file metadata like `created-by`/`modified-at`) could get nicer treatment: matching icons, and translated field names via the existing i18n system.
- The recipe list page could show a compact calorie badge next to the tags when `nutrition` is present, without cluttering the cards with the rest of the nutrition breakdown.
- A way to hide a family or a single entry from display (e.g. a `.`-prefixed key) would help for metadata that's useful to keep in the file but not show on the page.
## Proposed implementation
Opened as #458, which implements the above (generic rendering for any family, specific icon/i18n treatment for `nutrition` and `file`/`meta`, `.`-prefix hiding, kcal badge on the list page).
Contributor guide
Research direction
Start with issue #458, which is identified as implementing this proposal, and inspect the recipe page and recipe list rendering entry points it changes. Compare the implementation with the YAML examples and verify generic list/mapping display, special nutrition and file metadata treatment, hiding rules, and the calorie badge. Done means the requested metadata appears correctly without disrupting existing recipe fields.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100