Compare commits
2 Commits
486a852195
...
c113a2547f
| Author | SHA1 | Date | |
|---|---|---|---|
|
c113a2547f
|
|||
|
6b54f13b3f
|
@@ -24,7 +24,7 @@ export async function generateMetadata(props) {
|
|||||||
const {slug} = params
|
const {slug} = params
|
||||||
const anAwtis = await jwennAwtis(slug)
|
const anAwtis = await jwennAwtis(slug)
|
||||||
|
|
||||||
const title = `OKI | ${anAwtis.alias} - Paroles et Traductions`
|
const title = `PAWÒL-NU | ${anAwtis.alias}`
|
||||||
const description = `${anAwtis.alias}${anAwtis?.biographie ? ` : ${anAwtis?.biographie.slice(0, 100)}...` : ''}`
|
const description = `${anAwtis.alias}${anAwtis?.biographie ? ` : ${anAwtis?.biographie.slice(0, 100)}...` : ''}`
|
||||||
const url = `${siteUrl}/awtis/${slug}`
|
const url = `${siteUrl}/awtis/${slug}`
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -11,10 +11,10 @@ import {jwennAwtisPajinasyon} from '../../lib/oki-api'
|
|||||||
import Footer from '../../components/footer'
|
import Footer from '../../components/footer'
|
||||||
|
|
||||||
export const metadata = {
|
export const metadata = {
|
||||||
title: 'OKI | Awtis - Liste des artistes',
|
title: 'PAWÒL-NU | Artistes',
|
||||||
description: 'Liste des artistes ayant une ou plusieurs œuvres présentes sur le site.',
|
description: 'Liste des artistes ayant une ou plusieurs œuvres présentes sur le site.',
|
||||||
openGraph: {
|
openGraph: {
|
||||||
title: 'OKI | Awtis - Liste des artistes',
|
title: 'PAWÒL-NU | Artistes',
|
||||||
description: 'Liste des artistes ayant une ou plusieurs œuvres présentes sur le site.',
|
description: 'Liste des artistes ayant une ou plusieurs œuvres présentes sur le site.',
|
||||||
url: 'https://pawol.nu/sipote',
|
url: 'https://pawol.nu/sipote',
|
||||||
siteName: 'PAWÒL-NU. Paroles et traductions.',
|
siteName: 'PAWÒL-NU. Paroles et traductions.',
|
||||||
@@ -31,7 +31,7 @@ export const metadata = {
|
|||||||
twitter: {
|
twitter: {
|
||||||
site: '@OrganisationKA',
|
site: '@OrganisationKA',
|
||||||
card: 'summary_large_image',
|
card: 'summary_large_image',
|
||||||
title: 'OKI | Awtis - Liste des artistes',
|
title: 'PAWÒL-NU | Artistes',
|
||||||
description: 'Liste des artistes ayant une ou plusieurs œuvres présentes sur le site.',
|
description: 'Liste des artistes ayant une ou plusieurs œuvres présentes sur le site.',
|
||||||
creator: '@OrganisationKA',
|
creator: '@OrganisationKA',
|
||||||
images: {
|
images: {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export async function generateMetadata(props) {
|
|||||||
const anTeks = await jwennAnTeks(slug)
|
const anTeks = await jwennAnTeks(slug)
|
||||||
|
|
||||||
const awtis = anTeks?.artistes?.length === 1 ? anTeks?.artistes[0].alias : getAlias(anTeks.artistes, anTeks.prioriteArtistes)
|
const awtis = anTeks?.artistes?.length === 1 ? anTeks?.artistes[0].alias : getAlias(anTeks.artistes, anTeks.prioriteArtistes)
|
||||||
const title = `OKI | ${awtis} - ${anTeks.titre} | Paroles et Traductions`
|
const title = `PAWÒL-NU | ${awtis} - ${anTeks.titre}`
|
||||||
const description = `Paroles de « ${anTeks?.titre} » : ${anTeks?.transcription.slice(0, 100)}...`
|
const description = `Paroles de « ${anTeks?.titre} » : ${anTeks?.transcription.slice(0, 100)}...`
|
||||||
const url = `${siteUrl}/paroles/${slug}`
|
const url = `${siteUrl}/paroles/${slug}`
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,13 @@ import Box from '@mui/material/Box'
|
|||||||
import {notFound} from 'next/navigation'
|
import {notFound} from 'next/navigation'
|
||||||
|
|
||||||
import {jwennDenyeTeks} from '../../lib/oki-api'
|
import {jwennDenyeTeks} from '../../lib/oki-api'
|
||||||
|
import {formatKuveti} from '../../lib/kuveti'
|
||||||
import DenyeTeks from '../../components/teks/denye-teks'
|
import DenyeTeks from '../../components/teks/denye-teks'
|
||||||
import Footer from '../../components/footer'
|
import Footer from '../../components/footer'
|
||||||
|
|
||||||
|
const apiUrl = process.env.NEXT_PUBLIC_API_URL_ROOT || 'http://localhost:1337'
|
||||||
|
const siteUrl = process.env.NEXT_PUBLIC_SITE_URL || 'http://localhost:3000'
|
||||||
|
|
||||||
async function jwennDone() {
|
async function jwennDone() {
|
||||||
const denyeTeks = await jwennDenyeTeks()
|
const denyeTeks = await jwennDenyeTeks()
|
||||||
|
|
||||||
@@ -15,6 +19,38 @@ async function jwennDone() {
|
|||||||
return denyeTeks
|
return denyeTeks
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function generateMetadata() {
|
||||||
|
const denyeTeks = await jwennDone()
|
||||||
|
const couverture = formatKuveti(denyeTeks[0]?.couverture)
|
||||||
|
const imageUrl = couverture?.url ? `${apiUrl}${couverture.url}` : `${siteUrl}/logo-512x512.png`
|
||||||
|
const imageWidth = couverture?.width || 512
|
||||||
|
const imageHeight = couverture?.height || 512
|
||||||
|
const songList = denyeTeks.slice(0, 3).map(t => `${t.artistes[0]?.alias} – ${t.titre}`).join(', ')
|
||||||
|
const description = `Derniers morceaux : ${songList}…`
|
||||||
|
|
||||||
|
return {
|
||||||
|
title: 'PAWÒL-NU | Derniers morceaux',
|
||||||
|
description,
|
||||||
|
openGraph: {
|
||||||
|
title: 'PAWÒL-NU | Derniers morceaux',
|
||||||
|
description,
|
||||||
|
url: `${siteUrl}/paroles`,
|
||||||
|
siteName: 'PAWÒL-NU. Paroles et traductions.',
|
||||||
|
images: [{url: imageUrl, width: imageWidth, height: imageHeight}],
|
||||||
|
locale: 'fr_FR',
|
||||||
|
type: 'website',
|
||||||
|
},
|
||||||
|
twitter: {
|
||||||
|
site: '@OrganisationKA',
|
||||||
|
card: 'summary_large_image',
|
||||||
|
title: 'PAWÒL-NU | Derniers morceaux',
|
||||||
|
description,
|
||||||
|
creator: '@OrganisationKA',
|
||||||
|
images: {url: imageUrl, alt: 'Couverture du dernier morceau publié'},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export default async function PawolPaj() {
|
export default async function PawolPaj() {
|
||||||
const denyeTeks = await jwennDone()
|
const denyeTeks = await jwennDone()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user