Display custom recipe metadata (e.g. nutrition) on the recipe page
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 25/100
調査の方向性
この提案の実装として特定されている issue #458 から始め、変更対象となるレシピページとレシピ一覧のレンダリングのエントリポイントを調査してください。実装を YAML の例と比較し、汎用的なリスト/マッピング表示、栄養情報とファイルメタデータの特別な扱い、非表示ルール、カロリーバッジを確認してください。既存のレシピフィールドに影響を与えず、要求されたメタデータが正しく表示されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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 likecreated-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
nutritionis 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).
- 主要言語
- Rust
- スター
- 1.4k
- フォーク
- 120
- 平均マージ
- 1日 22時間
- マージ済み PR(30日)
- 128
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cooklang/cookcli のほかの issue
-
Editor save status and save errors are in English whatever the site's language対応中かも @LeMyst が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Shopping list counts a recipe twice when three or more menus reference each other in a ring対応中かも @LeMyst が 1 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
-
feat(server): tag pages, so a recipe can belong to several collections対応中かも @LeMyst が 2 日前に担当しました。 オープンarea: server feature request
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
wontfix
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
cooklang/cookcli#784 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
cooklang/cookcli#763 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
cooklang/cookcli の issue をすべて見る
似ている issue
-
good first issue help wanted r-docs
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
servo/rust-smallvec#824 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
priority middle
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
KATO-Hiro/AtCoderClans#12940 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
o8 next debug build aborts on Glass to Dark appearance switch (nil identifier messaged before check)オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
hurttlocker/o8#5112 ·