ADR 0333: A recipe is exported as the same schema.org Recipe node its page carries, and adaptedFrom is the only new field
- Status: Accepted
- Date: 2026-10-29
- Parent epic: #385
- Story: #397 (task DIST5.1.1)
Context#
Recipe posts (profile: recipe) already carry a schema.org Recipe node in the page's JSON-LD graph, built in the
renderer from the front matter (servings, makes, prep, cook, total, cuisine, course, calories) and the
lists under the ingredients and steps headings. The epic asks for an interoperable export that keeps the Markdown and
the canonical page as the source of truth, invents no facts, and lets the author choose where the recipe goes.
Provider facts, checked on 2026-10-29:
- schema.org Recipe:
recipeIngredient(Text),recipeInstructions(an ordered list of steps,HowToStep),recipeYield(Text or QuantitativeValue),prepTime,cookTime,totalTime(ISO 8601 Duration),recipeCuisine,recipeCategory,nutrition(NutritionInformation), and from CreativeWorkisBasedOn(CreativeWork, Product or URL): "a resource from which this work is derived or from which it is a modification or adaptation". - Google Search, Recipe structured data:
nameandimageare required for a recipe result;recipeIngredientholds one ingredient per entry with only the text needed to make it; instructions are best given asHowToStepwithtext, without "Step 1" labels; times are ISO 8601,prepTimeis used together withcookTime(ortotalTimealone);nutrition.caloriesneedsrecipeYield. - Mealie, a common self-hosted recipe manager, imports a recipe from a page URL with its scraper or from pasted "structured HTML or JSON". Recipe managers that import a URL read the page's schema.org data, so the page itself is the importer-friendly link. No importer offers an API this project may call on the author's behalf, and none is called.
Decision#
- One mapping.
openblog_core::recipe_schema::recipe_nodebuilds theRecipenode from the site settings, the published post and its parsed recipe. The renderer's JSON-LD graph uses it unchanged (the generated example site is byte-for-byte identical before and after the move), andrecipe_documentadds"@context": "https://schema.org"for a standalone file. Field by field: title toname, description, publication date, canonical address tourlandmainEntityOfPage, tags tokeywords, the site author toauthor,covertoimage, ingredient lines torecipeIngredient(plain text, in order), steps toHowToStepwithpositionandtext, times that are one length to ISO 8601,servings(a plain number gets "servings") andmakestorecipeYield,cuisine,coursetorecipeCategory,caloriestonutrition.calories. - Nothing is guessed. A time written as text ("overnight", "10-15 min") is left out; servings that are not a number and every ingredient line travel as the author wrote them. Amounts are not parsed into structured values and units are not converted, because the ingredient line is the author's text and a conversion would be a new fact.
adaptedFromis the only new front matter field (alsoadapted_from,basedOn). When it is an absolutehttporhttpsaddress it becomesisBasedOnon both the page and the export; anything else is left out of both and reported by the check (ADR 0334). A recipe without it has exactly the data it had.- The export is a local file.
openblog export <slug> --format recipe-json-ld [--out <path> --write]follows the other portable exports: published posts only, a dry run by default,--jsonfor a versioned plan, never overwriting a file, and the publication boundary scan (ADR 0125). It sends nothing and reads no credential, so it needs no provider manifest (ADR 0325); a destination that receives a recipe is a separate, opt-in step (story #398).
Considered options#
- A recipe file written by every build. Rejected: it would change every recipe site's output; the page already carries the same data for importers, and the export is for an author who asks.
- Structured ingredients (
PropertyValuewith amount and unit). Rejected for now: no major consumer requires it, the reader's scaler works on text, and splitting the author's line risks inventing a unit or an amount. - h-recipe or microdata markup. Not added: the page's JSON-LD is what search engines and the scrapers of recipe managers read; a second vocabulary would change every recipe page for little gain.
Consequences#
- An importer reading the page and one reading the export see the same node; a test pins that, and that the visible lists say what the data says.
- A change to the mapping changes both, on purpose.