Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

feat(server): tag pages, so a recipe can belong to several collections

Aperta
#785 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@LeMyst ci sta già lavorando.

Dal 27/10/2026.

  • #795 di @LeMyst — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
html, rust

Direzione di ricerca

Start with src/build/index.rs::collect to see how the existing tree walk gathers recipe.tags() and URL stems, then factor that walk into src/web/builders.rs. Read recipes_handler in src/server/ui.rs for the route pattern, and render_directory in src/build/mod.rs plus src/build/renderer.rs for static output; the card markup to extract lives in templates/recipes.html, with strings in locales/*/. Done when /tags and /tag/{tag} list and link tags case-insensitively, cook build web emits tags.html and tag/<tag>.html, and collector, isolated-server, build and Playwright tests cover the listed cases.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area: server feature request

Problem

Folders give each recipe exactly one place. A recipe like "red sauce pasta" belongs in lunch, dinner, pasta and easy meals all at once, and moving or copying the file is not an answer. This came up on Discord: someone wanted "collections" in cook server that can reference the same recipe file more than once.

Tags already cover the writing side. tags: [dinner, pasta] (or tags: dinner, pasta) in the frontmatter is parsed, and the server shows tags on the recipe cards (templates/recipes.html) and on the recipe page (templates/recipe.html). They are plain text, though, and no page lists "every recipe tagged dinner".

Proposal: tag pages

  1. Writing stays the same. Frontmatter tags, on .cook and .menu files.
  2. /tag/dinner shows every recipe and menu tagged dinner, from every folder, in one flat grid with the same cards as the home page. Each card shows its folder (Pasta/), so two recipes with the same name can be told apart. Sorted by name.
  3. /tags lists every tag with its count (dinner · 14). The home page and the small-screen menu link to it.
  4. Tags become links. On the recipe page, #dinner links to /tag/dinner. The tags on listing cards stay plain text for now, because each card is already a single <a> and a link cannot sit inside another link.
  5. Matching ignores case and surrounding spaces: Dinner and dinner are the same tag, shown with the spelling seen first. There is no hierarchy, so meal/dinner is just a name.
  6. Static sites: cook build web also renders tags.html and tag/<name>.html.

Not in a first version, but possible follow-ups: combining tags (?tag=dinner&tag=easy), filter chips on folder pages, and cook search --tag.

Implementation sketch
  • Collect: walk cooklang_find::build_tree(base_path) once, as src/build/index.rs::collect already does (recipe.tags(), URL stem from file_name()). Factor that walk into a shared helper in src/web/builders.rs that both the new builders and the static search index use.
  • Templates: move the card markup out of templates/recipes.html into an include, so the tag page renders the same cards. Add tags.html and tag.html with structs in src/web/templates.rs, reusing RecipeItem with an added folder: Option<String>.
  • Routes: GET /tags and GET /tag/{*tag} in src/server/ui.rs, following the recipes_handler pattern. Both are read-only GETs, so auth::middleware::required_capability needs no change and the reader role can see them.
  • Static build: render_tags / render_tag in src/build/renderer.rs, called from src/build/mod.rs next to render_directory. File names are percent-encoded for tags containing spaces or /. Add the pages to sitemap.rs.
  • i18n: a few new strings in all locales/*/.
  • API: /api/recipes already returns normalised tags, so API clients can filter today. No new endpoint is needed.
  • Tests: unit tests for the collector (case folding, menus, the same tag in two folders, untagged recipes); a cook server integration test through common::with_isolated_config; a Playwright test going from a recipe's tag to the tag page; cook build web output.
Lingua principale
Rust
Stelle
1.4k
Fork
120
Merge medio
1g 22h
PR unite (30g)
128

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cooklang/cookcli

Tutte le issue di cooklang/cookcli

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.