Skip to content

Commit

Permalink
Fix buildInstruction function (#723)
Browse files Browse the repository at this point in the history
* fix buildInstruction func

* Update recipe.tsx
  • Loading branch information
383bd03d committed Jun 18, 2021
1 parent 87123c1 commit e8d99ee
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/jsonld/recipe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ import { buildAggregateRating } from '../utils/buildAggregateRating';
import { Video, AggregateRating } from '../types';

type Instruction = {
name: string;
name?: string;
text: string;
url?: string;
image?: string;
};

export const buildInstruction = (instruction: Instruction) => `{
"@type": "HowToStep",
"name": "${instruction.name}",
"text": "${instruction.text}",
"url": "${instruction.url}",
"image": "${instruction.image}"
${instruction.name ? `"name": "${instruction.name}",` : ''}
${instruction.image ? `"image": "${instruction.image}",` : ''}
${instruction.url ? `"url": "${instruction.url}",` : ''}
"text": "${instruction.text}"
}`;

export interface RecipeJsonLdProps {
Expand Down

0 comments on commit e8d99ee

Please sign in to comment.