merge: deploy/aep-y-ac — checkpoint AEP (intégration du 22/10)
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import { canoniqueEvenement, estHoteEvenement, lienEvenement, SITE_EVENT } from '~/utils/evenements'
|
||||
|
||||
/**
|
||||
* Pages d'événement : sur quel hôte on est, comment écrire un lien, et la tête SEO.
|
||||
* La canonique et le robots posés ici l'emportent sur ceux du plugin B23 (mêmes clés,
|
||||
* mêmes valeurs) : Y part seul en prod, avant B23.
|
||||
*/
|
||||
export function useEvenement() {
|
||||
const surEvent = estHoteEvenement(useRequestURL().hostname)
|
||||
const lien = (chemin: string) => lienEvenement(chemin, surEvent)
|
||||
|
||||
function seo(o: { chemin: string; titre: string; description: string; image: string; alt: string }) {
|
||||
const canon = canoniqueEvenement(o.chemin)
|
||||
const image = SITE_EVENT + o.image
|
||||
useSeoMeta({
|
||||
title: o.titre,
|
||||
description: o.description,
|
||||
ogTitle: o.titre,
|
||||
ogDescription: o.description,
|
||||
ogImage: image,
|
||||
ogImageAlt: o.alt,
|
||||
ogUrl: canon,
|
||||
ogType: 'website',
|
||||
ogLocale: 'fr_FR',
|
||||
twitterCard: 'summary_large_image',
|
||||
})
|
||||
useHead({
|
||||
link: [{ rel: 'canonical', href: canon }],
|
||||
meta: surEvent ? [] : [{ name: 'robots', content: 'noindex, follow' }],
|
||||
})
|
||||
}
|
||||
|
||||
return { surEvent, lien, seo }
|
||||
}
|
||||
Reference in New Issue
Block a user