Skip to content

Commit

Permalink
Bugfix for recipe ingredients structured data and removed some leftov…
Browse files Browse the repository at this point in the history
…ers from prev implementation
  • Loading branch information
MGHollander committed Jul 3, 2024
1 parent 282fcc5 commit 9890a94
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions app/Http/Controllers/Recipe/RecipeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,6 @@ public function show(Request $request, string $slug)
'source_label' => $recipe->source_label,
'source_link' => $recipe->source_link,
'created_at' => $recipe->created_at,
'structured_data' => [
'description' => strip_tags($recipe->summary),
'ingredients' => new StructuredDataIngredientsResource($recipe->ingredients),
'instructions' => new InstructionsResource($recipe->instructions),
'keywords' => implode(',', $recipe->tags->pluck('name')->toArray()),
],
],
])->withViewData([
'open_graph' => [
Expand Down Expand Up @@ -252,7 +246,7 @@ private function setJsonLdData(Recipe $recipe): void
JsonLd::addValues([
'datePublished' => $recipe->created_at,
'recipeYield' => $recipe->servings,
'ingredients' => new StructuredDataIngredientsResource($recipe->ingredients),
'recipeIngredient' => new StructuredDataIngredientsResource($recipe->ingredients),
'recipeInstructions' => new InstructionsResource($recipe->instructions),
]);

Expand Down

0 comments on commit 9890a94

Please sign in to comment.