diff --git a/components/head-layout.js b/components/head-layout.js index e471b3b..62fc605 100644 --- a/components/head-layout.js +++ b/components/head-layout.js @@ -14,7 +14,8 @@ export default function HeadLayout({ imageMime, title, tab, - slug + slug, + summary }) { return (
@@ -29,21 +30,21 @@ export default function HeadLayout({ - + - + - + @@ -66,7 +67,8 @@ HeadLayout.propTypes = { imageMime: PropTypes.string, title: PropTypes.string, tab: PropTypes.number.isRequired, - slug: PropTypes.string + slug: PropTypes.string, + summary: PropTypes.string } HeadLayout.defaultProps = { @@ -75,5 +77,6 @@ HeadLayout.defaultProps = { imageHeight: null, imageMime: null, title: null, - slug: null + slug: null, + summary: null } diff --git a/pages/paroles/[slug].js b/pages/paroles/[slug].js index b3edc91..3beb4f5 100644 --- a/pages/paroles/[slug].js +++ b/pages/paroles/[slug].js @@ -19,6 +19,8 @@ export default function SlugTeks({hasError, errorMessage, parole, slug}) { return } + const summary = `Paroles de « ${parole?.attributes?.titre} » : ${parole?.attributes?.transcription.slice(0, 100)}...` + const artistes = parole.attributes.artistes.length === 1 ? parole.attributes.artistes[0].data.attributes.alias : getAlias(parole.attributes.artistes, parole.attributes.prioriteArtistes) const {couverture} = parole.attributes const formatKouveti = () => { @@ -48,6 +50,7 @@ export default function SlugTeks({hasError, errorMessage, parole, slug}) { imageHeight={formatKouveti() ? formatKouveti().height : null} imageMime={formatKouveti() ? formatKouveti().mime : null} title={`${artistes} - ${parole.attributes.titre} | Paroles et Traductions`} tab={1} slug={`paroles/${slug}`} + summary={summary} >