Problem
Cooklang's YAML frontmatter supports arbitrary custom metadata keys beyond the standard ones (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":
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).
Problem
Cooklang's YAML frontmatter supports arbitrary custom metadata keys beyond the standard ones (
servings,time,course, ...), but CookCLI's web UI only shows a handful of known fields as pills, plus flat scalar custom fields askey: valuepills. 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":
allergens:above should just work.nutrition, and file metadata likecreated-by/modified-at) could get nicer treatment: matching icons, and translated field names via the existing i18n system.nutritionis present, without cluttering the cards with the rest of the nutrition breakdown..-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
nutritionandfile/meta,.-prefix hiding, kcal badge on the list page).