Skip to content

Commit

Permalink
update json-ld schema
Browse files Browse the repository at this point in the history
  • Loading branch information
geromegrignon authored May 30, 2024
1 parent 5dd2ac0 commit 62c20ab
Showing 1 changed file with 64 additions and 35 deletions.
99 changes: 64 additions & 35 deletions angular-hub/src/app/pages/index.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,41 +134,70 @@ export default class EventsComponent {
setJsonLd() {
return {
'@context': 'https://schema.org',
'@type': 'ItemList',
itemListElement: this.events().map((event, index) => ({
'@type': 'ListItem',
position: index + 1,
item: {
'@type': 'Event',
name: event.name,
url: event.url,
startDate: event.date,
...(event.location
? {
location: {
'@type': 'Place',
name: event.location,
},
}
: {}),
...(event.isRemote
? {
location: {
'@type': 'VirtualLocation',
name: 'Online',
},
}
: {}),
...(event.language
? {
inLanguage: {
'@type': 'Language',
name: event.language,
},
}
: {}),
},
})),
"@type": "WebSite",
"url": "https://angular-hub.com/",
"name": "Angular Hub",
"description": "Curated list of Angular Communities, Events, Podcasts, and Call for Papers.",
"audience": {
"@type": "Audience",
"audienceType": "Developers",
"description": "Developers interested in Angular and related technologies."
},
"author": {
"@type": "Person",
"name": "Gerome Grignon",
"url": "https://www.gerome.dev/",
"sameAs": [
"https://twitter.com/GeromeDEV",
"https://www.linkedin.com/in/gerome-grignon/",
"https://github.com/geromegrignon"
]
},
"mainEntity": [
{
"@type": "ItemList",
"name": "Angular Events",
itemListElement: this.events().map((event, index) => ({
'@type': 'ListItem',
position: index + 1,
item: {
'@type': 'Event',
name: event.name,
url: event.url,
"audience": {
"@type": "Audience",
"audienceType": "Developers",
"description": "Developers interested in Angular and related technologies."
},
startDate: event.date,
...(event.location
? {
location: {
'@type': 'Place',
name: event.location,
},
}
: {}),
...(event.isRemote
? {
location: {
'@type': 'VirtualLocation',
name: 'Online',
},
}
: {}),
...(event.language
? {
inLanguage: {
'@type': 'Language',
name: event.language,
},
}
: {}),
},
})),
}
]
};
}
}

0 comments on commit 62c20ab

Please sign in to comment.