forked from garmeeh/next-seo
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add EventJsonLd component (garmeeh#149)
- Loading branch information
1 parent
bd03bcb
commit f1c1f09
Showing
12 changed files
with
346 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { versionSchemas } from '@cypress/schema-tools'; | ||
|
||
const address100 = { | ||
version: { | ||
major: 1, | ||
minor: 0, | ||
patch: 0, | ||
}, | ||
schema: { | ||
type: 'object', | ||
description: "Array of social profile URL's", | ||
properties: { | ||
'@type': { | ||
type: 'string', | ||
description: 'JSON-LD type: PostalAddress', | ||
}, | ||
streetAddress: { | ||
type: 'string', | ||
description: 'Street number, street name, and unit number', | ||
}, | ||
addressLocality: { | ||
type: 'string', | ||
description: 'City', | ||
}, | ||
addressRegion: { | ||
type: 'string', | ||
description: 'State or province, if applicable.', | ||
}, | ||
postalCode: { | ||
type: 'string', | ||
description: 'Postal or zip code.', | ||
}, | ||
addressCountry: { | ||
type: 'string', | ||
description: 'The 2-letter ISO 3166-1 alpha-2 country code', | ||
}, | ||
}, | ||
}, | ||
example: { | ||
'@type': 'PostalAddress', | ||
streetAddress: '1600 Saratoga Ave', | ||
addressLocality: 'San Jose', | ||
addressRegion: 'CA', | ||
postalCode: '95129', | ||
addressCountry: 'US', | ||
}, | ||
}; | ||
|
||
const address = versionSchemas(address100); | ||
export default address; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import { versionSchemas } from '@cypress/schema-tools'; | ||
|
||
import address100 from './address'; | ||
|
||
const location100 = { | ||
version: { | ||
major: 1, | ||
minor: 0, | ||
patch: 0, | ||
}, | ||
schema: { | ||
type: 'object', | ||
description: 'Location', | ||
properties: { | ||
'@type': { | ||
type: 'string', | ||
description: 'Location type', | ||
}, | ||
name: { | ||
type: 'string', | ||
description: 'Location name', | ||
}, | ||
address: { | ||
...address100.schema, | ||
see: address100, | ||
}, | ||
}, | ||
}, | ||
example: { | ||
'@type': 'Place', | ||
name: 'My place', | ||
address: address100.example, | ||
}, | ||
}; | ||
|
||
const event100 = { | ||
version: { | ||
major: 1, | ||
minor: 0, | ||
patch: 0, | ||
}, | ||
schema: { | ||
type: 'object', | ||
title: 'Event', | ||
properties: { | ||
'@type': { | ||
type: 'string', | ||
description: 'Event type', | ||
}, | ||
name: { | ||
type: 'string', | ||
description: 'Event name', | ||
}, | ||
startDate: { | ||
type: 'string', | ||
description: 'Event start date', | ||
}, | ||
endDate: { | ||
type: 'string', | ||
description: 'Event end date', | ||
}, | ||
location: { | ||
...location100.schema, | ||
see: location100, | ||
}, | ||
}, | ||
}, | ||
example: { | ||
'@context': 'http://schema.org', | ||
'@type': 'Event', | ||
name: 'My event', | ||
startDate: '2020-01-23T00:00:00.000Z', | ||
endDate: '2020-02-24T00:00:00.000Z', | ||
location: location.example, | ||
image: ['https://example.com/photos/1x1/photo.jpg'], | ||
description: 'My event @ my place', | ||
}, | ||
}; | ||
|
||
const event = versionSchemas(event100); | ||
export default event; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.