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