Add id and cover to jsonLd awtis and paroles
This commit is contained in:
@@ -65,11 +65,16 @@ export default async function AwtisPajSlug({params}) {
|
||||
const {slug} = params
|
||||
const anAwtis = await jwennAwtis(slug)
|
||||
|
||||
const {photo} = anAwtis.attributes
|
||||
const kuvetiFormat = formatKuveti(photo)
|
||||
|
||||
const jsonLd = {
|
||||
'@context': 'http://schema.org',
|
||||
'@type': 'Person',
|
||||
'@id': anAwtis.attributes.musicBrainzUrl || undefined,
|
||||
name: anAwtis.attributes.alias,
|
||||
url: `${siteUrl}/awtis/${slug}`
|
||||
url: `${siteUrl}/awtis/${slug}`,
|
||||
image: kuvetiFormat?.url ? `${apiUrl}${kuvetiFormat.url}` : undefined
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -69,17 +69,29 @@ export default async function AnPawolPaj({params}) {
|
||||
const {slug} = params
|
||||
|
||||
const anTeks = await jwennAnTeks(slug)
|
||||
const {couverture} = anTeks.attributes
|
||||
const teksKuvetiFormat = formatKuveti(couverture)
|
||||
|
||||
const jsonLd = {
|
||||
'@context': 'http://schema.org',
|
||||
'@type': 'MusicRecording',
|
||||
'@id': anTeks.attributes.musicBrainzUrl || undefined,
|
||||
name: anTeks.attributes.titre,
|
||||
url: `${siteUrl}/paroles/${slug}`,
|
||||
byArtist: anTeks.attributes.artistes.data.map(({attributes}) => ({
|
||||
image: teksKuvetiFormat?.url ? `${apiUrl}${teksKuvetiFormat?.url}` : undefined,
|
||||
thumbnailUrl: couverture?.data?.attributes?.formats?.thumbnail?.url ? `${apiUrl}${couverture.data.attributes.formats.thumbnail.url}` : undefined,
|
||||
byArtist: anTeks.attributes.artistes.data.map(({attributes}) => {
|
||||
const {photo} = attributes
|
||||
const kuvetiFormat = formatKuveti(photo)
|
||||
|
||||
return {
|
||||
'@type': 'Person',
|
||||
'@id': attributes.musicBrainzUrl || undefined,
|
||||
name: attributes.alias,
|
||||
url: `${siteUrl}/awtis/${attributes.slug}`
|
||||
})),
|
||||
url: `${siteUrl}/awtis/${attributes.slug}`,
|
||||
image: kuvetiFormat?.url ? `${apiUrl}${kuvetiFormat?.url}` : undefined
|
||||
}
|
||||
}),
|
||||
datePublished: anTeks.attributes?.annee
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user