Skip to content

Commit

Permalink
Add optional servesCuisine (#546)
Browse files Browse the repository at this point in the history
  • Loading branch information
valse committed Oct 31, 2020
1 parent bf6a5e3 commit 7f53ad7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1360,6 +1360,7 @@ Local business is supported with a sub-set of properties.
| `rating.ratingValue` | The rating for the content. |
| `rating.ratingCount` | The count of total number of ratings. |
| `priceRange` | The relative price range of the business. |
| `servesCuisine` | The type of cuisine the restaurant serves. |
| `images` | An image or images of the business. Required for valid markup depending on the type |
| `telephone` | A business phone number meant to be the primary contact method for customers. |
| `url` | The fully-qualified URL of the specific business location. |
Expand Down
3 changes: 3 additions & 0 deletions src/jsonld/localBusiness.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export interface LocalBusinessJsonLdProps {
images?: string[];
rating?: Rating;
priceRange?: string;
servesCuisine?: string | string[];
sameAs?: string[];
openingHours?: OpeningHoursSpecification | OpeningHoursSpecification[];
}
Expand Down Expand Up @@ -89,6 +90,7 @@ const LocalBusinessJsonLd: FC<LocalBusinessJsonLdProps> = ({
images,
rating,
priceRange,
servesCuisine,
sameAs,
openingHours,
}) => {
Expand All @@ -103,6 +105,7 @@ const LocalBusinessJsonLd: FC<LocalBusinessJsonLdProps> = ({
${geo ? `${buildGeo(geo)}` : ''}
${rating ? `${buildRating(rating)}` : ''}
${priceRange ? `"priceRange": "${priceRange}",` : ''}
${servesCuisine ? `"servesCuisine":${formatIfArray(servesCuisine)},` : ''}
${images ? `"image":${formatIfArray(images)},` : ''}
${sameAs ? `"sameAs": [${sameAs.map(url => `"${url}"`)}],` : ''}
${
Expand Down

0 comments on commit 7f53ad7

Please sign in to comment.