feat: amélioration des meta og
This commit is contained in:
parent
408fa601f2
commit
e3bbd5b488
7 changed files with 21 additions and 15 deletions
|
|
@ -24,14 +24,14 @@ const URL = `${Astro.site}`; // Set the website URL in astro.config.mjs
|
|||
const author = SITE.author;
|
||||
const canonical = Astro.url.href;
|
||||
const basePath = Astro.url.pathname;
|
||||
const ogTitle = OG.title;
|
||||
const ogDescription = OG.description;
|
||||
const ogTitle = structuredData.name || OG.title;
|
||||
const ogDescription = structuredData.description || OG.description;
|
||||
const socialImageRes = await getImage({
|
||||
src: OG.image,
|
||||
width: 1200,
|
||||
height: 600,
|
||||
});
|
||||
const socialImage = Astro.url.origin + socialImageRes.src; // Get the full URL of the image (https://stackoverflow.com/a/9858694)
|
||||
const socialImage = structuredData.image || Astro.url.origin + socialImageRes.src; // Get the full URL of the image (https://stackoverflow.com/a/9858694)
|
||||
|
||||
const languages: { [key: string]: string } = {
|
||||
en: "",
|
||||
|
|
@ -93,9 +93,9 @@ const appleTouchIcon = await getImage({
|
|||
<meta property="og:locale" content="fr_FR" />
|
||||
<meta property="og:url" content={URL} />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:title" content={ogTitle} />
|
||||
<meta property="og:title" content={ ogTitle} />
|
||||
<meta property="og:site_name" content={SITE.title} />
|
||||
<meta property="og:description" content={ogDescription} />
|
||||
<meta property="og:description" content={structuredData.description || ogDescription} />
|
||||
<meta property="og:image" content={socialImage} />
|
||||
<meta content="1200" property="og:image:width" />
|
||||
<meta content="600" property="og:image:height" />
|
||||
|
|
|
|||
|
|
@ -11,11 +11,12 @@ import PrimaryCTA from "../components/ui/buttons/PrimaryCTA.astro";
|
|||
const structuredDescription = {
|
||||
"@context": "https://schema.org",
|
||||
"@type": "WebPage",
|
||||
"@id": "https://achat-maison-albi.fr/avec-piscine",
|
||||
"url": "https://achat-maison-albi.fr/avec-piscine",
|
||||
"@id": "https://achat-maison-albi.fr/avec-piscine/",
|
||||
"url": "https://achat-maison-albi.fr/avec-piscine/",
|
||||
"name": "Maison individuelle avec piscine à Albi",
|
||||
"description":
|
||||
"Piscine de 4m x 8m, soit 50m3, à l’abri des regards et fraiche toute l’année",
|
||||
image: photoDeLaPiscine as unknown as string,
|
||||
"isPartOf": websiteStructuredDescription,
|
||||
"inLanguage": "fr-FR"
|
||||
} satisfies WithContext<WebPage>
|
||||
|
|
|
|||
|
|
@ -12,11 +12,12 @@ import PrimaryCTA from "../components/ui/buttons/PrimaryCTA.astro";
|
|||
const structuredDescription = {
|
||||
"@context": "https://schema.org",
|
||||
"@type": "WebPage",
|
||||
"@id": "https://achat-maison-albi.fr/avec-terrasse",
|
||||
"url": "https://achat-maison-albi.fr/avec-terrasse",
|
||||
"@id": "https://achat-maison-albi.fr/avec-terrasse/",
|
||||
"url": "https://achat-maison-albi.fr/avec-terrasse/",
|
||||
"name": "Maison individuelle avec piscine à Albi",
|
||||
"description":
|
||||
"Piscine de 4m x 8m, soit 50m3, à l’abri des regards et fraiche toute l’année",
|
||||
image: photo3 as unknown as string,
|
||||
"isPartOf": websiteStructuredDescription,
|
||||
"inLanguage": "fr-FR"
|
||||
} satisfies WithContext<WebPage>
|
||||
|
|
@ -30,7 +31,7 @@ const structuredDescription = {
|
|||
title="Profitez du soleil"
|
||||
subTitle="Avec ses 50 m2 plein sud, la terrasse est une vraie pièce en plus."
|
||||
btnTitle="Entrez dans la maison"
|
||||
btnURL="/pieces"
|
||||
btnURL="/pieces/"
|
||||
>
|
||||
<p class="mb-8 max-w-prose text-pretty font-normal text-neutral-600 dark:text-neutral-400 sm:text-xl">
|
||||
Surplombant la piscine et permettant de la surveiller, la terrasse est assez large pour de grands dîners et de belles fêtes, autant que pour un livre au soleil.
|
||||
|
|
@ -45,6 +46,6 @@ const structuredDescription = {
|
|||
|
||||
<div class="mb-8">
|
||||
Vous voulez en savoir plus ?
|
||||
<PrimaryCTA title="Entrer dans la maison" url="/pieces" />
|
||||
<PrimaryCTA title="Entrer dans la maison" url="/pieces/" />
|
||||
</div>
|
||||
</MainLayout>
|
||||
|
|
|
|||
|
|
@ -16,12 +16,13 @@ import PrimaryCTA from "../components/ui/buttons/PrimaryCTA.astro";
|
|||
const structuredDescription = {
|
||||
"@context": "https://schema.org",
|
||||
"@type": "WebPage",
|
||||
"@id": "https://achat-maison-albi.fr/avec-un-grand-bureau",
|
||||
"url": "https://achat-maison-albi.fr/avec-un-grand-bureau",
|
||||
"@id": "https://achat-maison-albi.fr/avec-un-grand-bureau/",
|
||||
"url": "https://achat-maison-albi.fr/avec-un-grand-bureau/",
|
||||
"name": "Maison individuelle avec un grand bureau à Albi",
|
||||
"description":
|
||||
"Idéal pour les télétravailleurs et indépendants ! Grand bureau connecté et sécurisé dans cette belle maison individuelle de 177 m2.",
|
||||
"isPartOf": websiteStructuredDescription,
|
||||
"image": photo1 as unknown as string,
|
||||
"inLanguage": "fr-FR"
|
||||
} satisfies WithContext<WebPage>
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ const structuredDescription = {
|
|||
"name": "Maison individuelle en fond d’impasse à Albi",
|
||||
"description":
|
||||
"Dans un fond d’impasse sans voiture, et grande facilité pour se garer.",
|
||||
image: photoVueAerienne as unknown as string,
|
||||
"isPartOf": websiteStructuredDescription,
|
||||
"inLanguage": "fr-FR"
|
||||
} satisfies WithContext<WebPage>
|
||||
|
|
|
|||
|
|
@ -118,6 +118,7 @@ const pageTitle: string = `Pièces de la maison | 177m2 à vendre à Albi`;
|
|||
"url": "https://achat-maison-albi.fr/pieces/",
|
||||
"name": "Pièces de la maison | 177m2 à vendre à Albi",
|
||||
"description": "Avec 5 chambres, 3 salles d’eau, un bureau et des beaux espaces de vie intérieurs comme extérieurs, notre maison est accueillante et conviviale.",
|
||||
image: photoSalonCheminee as unknown as string,
|
||||
"isPartOf": websiteStructuredDescription,
|
||||
"inLanguage": "fr-FR"
|
||||
}}
|
||||
|
|
@ -126,7 +127,7 @@ const pageTitle: string = `Pièces de la maison | 177m2 à vendre à Albi`;
|
|||
title="Des espaces pour chacun et chacune"
|
||||
subTitle="Avec 5 chambres, 3 salles d’eau, un bureau et des beaux espaces de vie intérieurs comme extérieurs, notre maison est accueillante et conviviale."
|
||||
btnTitle="Nous contacter"
|
||||
btnURL="/contact"
|
||||
btnURL="/contact/"
|
||||
/>
|
||||
|
||||
{
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ const structuredDescription = {
|
|||
"url": "https://achat-maison-albi.fr/quartier-cantepau",
|
||||
"name": "Maison individuelle en fond d’impasse à Cantepau",
|
||||
"description": "Écoles, commerces, médiathèque et maison de quartier à 5 minutes à pied.",
|
||||
image: vueCathedrale as unknown as string,
|
||||
"isPartOf": websiteStructuredDescription,
|
||||
"inLanguage": "fr-FR"
|
||||
} satisfies WithContext<WebPage>
|
||||
|
|
@ -53,6 +54,6 @@ const structuredDescription = {
|
|||
|
||||
<div class="mb-8">
|
||||
Vous voulez en savoir plus ?
|
||||
<PrimaryCTA title="Entrer dans la maison" url="/pieces" />
|
||||
<PrimaryCTA title="Entrer dans la maison" url="/pieces/" />
|
||||
</div>
|
||||
</MainLayout>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue