Fix image url
This commit is contained in:
@@ -4,7 +4,7 @@ import Head from 'next/head'
|
|||||||
import Navigasyon from './navigasyon'
|
import Navigasyon from './navigasyon'
|
||||||
|
|
||||||
const siteUrl = process.env.NEXT_PUBLIC_SITE_URL || 'http://localhost:3000'
|
const siteUrl = process.env.NEXT_PUBLIC_SITE_URL || 'http://localhost:3000'
|
||||||
const apiUrl = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:1337'
|
const apiUrl = process.env.NEXT_PUBLIC_API_URL_ROOT || 'http://localhost:1337'
|
||||||
|
|
||||||
export default function HeadLayout({
|
export default function HeadLayout({
|
||||||
children,
|
children,
|
||||||
|
|||||||
@@ -26,23 +26,23 @@ export default function SlugTeks({hasError, errorMessage, paroles, parole, slug,
|
|||||||
const artistes = parole.attributes.artistes.length === 1 ? parole.attributes.artistes[0].data.attributes.alias : jwennAwtis(parole.attributes.artistes)
|
const artistes = parole.attributes.artistes.length === 1 ? parole.attributes.artistes[0].data.attributes.alias : jwennAwtis(parole.attributes.artistes)
|
||||||
const {couverture} = parole.attributes
|
const {couverture} = parole.attributes
|
||||||
const formatKouveti = () => {
|
const formatKouveti = () => {
|
||||||
if (!couverture) {
|
if (!couverture?.data?.attributes) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
if (couverture && couverture.formats && couverture.formats.large) {
|
if (couverture.data.attributes && couverture.data.attributes.formats && couverture.data.attributes.formats.large) {
|
||||||
return couverture.formats.large
|
return couverture.formats.large
|
||||||
}
|
}
|
||||||
|
|
||||||
if (couverture && couverture.formats && couverture.formats.medium) {
|
if (couverture.data.attributes && couverture.data.attributes.formats && couverture.data.attributes.formats.medium) {
|
||||||
return couverture.formats.medium
|
return couverture.formats.medium
|
||||||
}
|
}
|
||||||
|
|
||||||
if (couverture && couverture.formats && couverture.formats.small) {
|
if (couverture.data.attributes && couverture.data.attributes.formats && couverture.data.attributes.formats.small) {
|
||||||
return couverture.formats.small
|
return couverture.formats.small
|
||||||
}
|
}
|
||||||
|
|
||||||
return couverture
|
return couverture.data.attributes
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user