You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Display custom recipe metadata (e.g. nutrition) on the recipe page #459
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: 234proteins: 9.8lipids: 17.6allergens:
- 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).
Activity