Improving SEO
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
User-agent: *
|
||||||
|
Allow: /
|
||||||
|
|
||||||
|
Sitemap: https://coeur-ua-pam.fr/sitemap.xml
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
|
<url>
|
||||||
|
<loc>https://coeur-ua-pam.fr/</loc>
|
||||||
|
<lastmod>2025-03-25</lastmod>
|
||||||
|
<priority>1.0</priority>
|
||||||
|
</url>
|
||||||
|
<url>
|
||||||
|
<loc>https://coeur-ua-pam.fr/a-propos</loc>
|
||||||
|
<lastmod>2025-03-25</lastmod>
|
||||||
|
<priority>0.8</priority>
|
||||||
|
</url>
|
||||||
|
<url>
|
||||||
|
<loc>https://coeur-ua-pam.fr/notre-histoire</loc>
|
||||||
|
<lastmod>2025-03-25</lastmod>
|
||||||
|
<priority>0.8</priority>
|
||||||
|
</url>
|
||||||
|
<url>
|
||||||
|
<loc>https://coeur-ua-pam.fr/evenements</loc>
|
||||||
|
<lastmod>2025-03-25</lastmod>
|
||||||
|
<priority>0.8</priority>
|
||||||
|
</url>
|
||||||
|
</urlset>
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
import { useEffect } from "react";
|
||||||
|
|
||||||
|
interface SEOProps {
|
||||||
|
title: string;
|
||||||
|
description: string;
|
||||||
|
type?: string;
|
||||||
|
image?: string;
|
||||||
|
url?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function SEO({
|
||||||
|
title,
|
||||||
|
description,
|
||||||
|
type = "website",
|
||||||
|
image = "/logo.png",
|
||||||
|
url,
|
||||||
|
}: SEOProps) {
|
||||||
|
useEffect(() => {
|
||||||
|
const siteName = "Cœur UA PAM";
|
||||||
|
const fullTitle = `${title} | ${siteName}`;
|
||||||
|
|
||||||
|
// Mise à jour du titre de l'onglet
|
||||||
|
document.title = fullTitle;
|
||||||
|
|
||||||
|
// Utilitaire pour mettre à jour ou créer des balises meta
|
||||||
|
const setMeta = (name: string, content: string, isProperty = false) => {
|
||||||
|
const selector = isProperty
|
||||||
|
? `meta[property="${name}"]`
|
||||||
|
: `meta[name="${name}"]`;
|
||||||
|
let element = document.querySelector(selector);
|
||||||
|
if (!element) {
|
||||||
|
element = document.createElement("meta");
|
||||||
|
if (isProperty) element.setAttribute("property", name);
|
||||||
|
else element.setAttribute("name", name);
|
||||||
|
document.head.appendChild(element);
|
||||||
|
}
|
||||||
|
element.setAttribute("content", content);
|
||||||
|
};
|
||||||
|
|
||||||
|
const origin = window.location.origin;
|
||||||
|
const absoluteImage = image.startsWith("http")
|
||||||
|
? image
|
||||||
|
: `${origin}${image}`;
|
||||||
|
const absoluteUrl = url ? `${origin}${url}` : window.location.href;
|
||||||
|
|
||||||
|
// Balises standards
|
||||||
|
setMeta("description", description);
|
||||||
|
|
||||||
|
// Open Graph (Facebook, LinkedIn, etc.)
|
||||||
|
setMeta("og:title", fullTitle, true);
|
||||||
|
setMeta("og:description", description, true);
|
||||||
|
setMeta("og:type", type, true);
|
||||||
|
setMeta("og:url", absoluteUrl, true);
|
||||||
|
setMeta("og:image", absoluteImage, true);
|
||||||
|
setMeta("og:site_name", siteName, true);
|
||||||
|
|
||||||
|
// Twitter
|
||||||
|
setMeta("twitter:card", "summary_large_image");
|
||||||
|
setMeta("twitter:title", fullTitle);
|
||||||
|
setMeta("twitter:description", description);
|
||||||
|
setMeta("twitter:image", absoluteImage);
|
||||||
|
|
||||||
|
// Lien canonique
|
||||||
|
let canonical = document.querySelector('link[rel="canonical"]');
|
||||||
|
if (!canonical) {
|
||||||
|
canonical = document.createElement("link");
|
||||||
|
canonical.setAttribute("rel", "canonical");
|
||||||
|
document.head.appendChild(canonical);
|
||||||
|
}
|
||||||
|
canonical.setAttribute("href", absoluteUrl);
|
||||||
|
}, [title, description, type, image, url]);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
@@ -1,8 +1,14 @@
|
|||||||
import AnimatedContent from "../components/AnimatedContent";
|
import AnimatedContent from "../components/AnimatedContent";
|
||||||
|
import SEO from "../components/SEO";
|
||||||
|
|
||||||
const About = () => {
|
const About = () => {
|
||||||
return (
|
return (
|
||||||
<div className="w-full pb-20 flex flex-col gap-16 md:gap-24">
|
<div className="w-full pb-20 flex flex-col gap-16 md:gap-24">
|
||||||
|
<SEO
|
||||||
|
title="L'Association"
|
||||||
|
description="Découvrez les missions de Cœur UA PAM : Solidarité, Culture et Entraide. Nos actions pour l'intégration et le soutien logistique en Ukraine."
|
||||||
|
url="/a-propos"
|
||||||
|
/>
|
||||||
<AnimatedContent distance={60} direction="vertical" duration={1}>
|
<AnimatedContent distance={60} direction="vertical" duration={1}>
|
||||||
<div className="relative w-full h-[80vh] min-h-125 overflow-hidden shadow-2xl group">
|
<div className="relative w-full h-[80vh] min-h-125 overflow-hidden shadow-2xl group">
|
||||||
<img
|
<img
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { useLayoutEffect, useRef, useState, useCallback } from "react";
|
import { useLayoutEffect, useRef, useState, useCallback } from "react";
|
||||||
import AnimatedContent from "../components/AnimatedContent";
|
import AnimatedContent from "../components/AnimatedContent";
|
||||||
|
import SEO from "../components/SEO";
|
||||||
|
|
||||||
// --- INTERFACES TYPESCRIPT ---
|
// --- INTERFACES TYPESCRIPT ---
|
||||||
interface EventIntro {
|
interface EventIntro {
|
||||||
@@ -693,6 +694,11 @@ export default function Events() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="w-full max-w-[100vw] overflow-x-clip pb-20 flex flex-col gap-16 md:gap-24 bg-bg-1">
|
<div className="w-full max-w-[100vw] overflow-x-clip pb-20 flex flex-col gap-16 md:gap-24 bg-bg-1">
|
||||||
|
<SEO
|
||||||
|
title="Nos Événements"
|
||||||
|
description="Retrouvez l'historique de nos mobilisations : Octobre Rose, Marchés de Noël, repas solidaires et commémorations."
|
||||||
|
url="/evenements"
|
||||||
|
/>
|
||||||
<AnimatedContent distance={60} direction="vertical" duration={1}>
|
<AnimatedContent distance={60} direction="vertical" duration={1}>
|
||||||
<div className="relative w-full h-[80vh] min-h-125 overflow-hidden shadow-2xl group">
|
<div className="relative w-full h-[80vh] min-h-125 overflow-hidden shadow-2xl group">
|
||||||
<img
|
<img
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { useState } from "react";
|
|||||||
import AnimatedContent from "../components/AnimatedContent";
|
import AnimatedContent from "../components/AnimatedContent";
|
||||||
import Stepper, { Step } from "../components/Stepper";
|
import Stepper, { Step } from "../components/Stepper";
|
||||||
import FacebookCarousel from "../components/FacebookCarousel";
|
import FacebookCarousel from "../components/FacebookCarousel";
|
||||||
|
import SEO from "../components/SEO";
|
||||||
|
|
||||||
const StepWithBackground = ({
|
const StepWithBackground = ({
|
||||||
date,
|
date,
|
||||||
@@ -42,6 +43,11 @@ const Historic = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="w-full pb-20 flex flex-col gap-16 md:gap-24">
|
<div className="w-full pb-20 flex flex-col gap-16 md:gap-24">
|
||||||
|
<SEO
|
||||||
|
title="Notre Histoire"
|
||||||
|
description="De l'urgence de mars 2022 à la création officielle de l'association. Découvrez le parcours de solidarité de Cœur UA PAM."
|
||||||
|
url="/notre-histoire"
|
||||||
|
/>
|
||||||
<AnimatedContent distance={60} direction="vertical" duration={1}>
|
<AnimatedContent distance={60} direction="vertical" duration={1}>
|
||||||
<div className="relative w-full h-[80vh] min-h-125 overflow-hidden shadow-2xl group">
|
<div className="relative w-full h-[80vh] min-h-125 overflow-hidden shadow-2xl group">
|
||||||
<img
|
<img
|
||||||
|
|||||||
@@ -1,10 +1,16 @@
|
|||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import AnimatedContent from "../components/AnimatedContent";
|
import AnimatedContent from "../components/AnimatedContent";
|
||||||
import CountUp from "../components/ContUp";
|
import CountUp from "../components/ContUp";
|
||||||
|
import SEO from "../components/SEO";
|
||||||
|
|
||||||
const Home = () => {
|
const Home = () => {
|
||||||
return (
|
return (
|
||||||
<div className="w-full pb-20">
|
<div className="w-full pb-20">
|
||||||
|
<SEO
|
||||||
|
title="Accueil"
|
||||||
|
description="Association franco-ukrainienne Cœur UA PAM à Pont-à-Mousson. Soutien humanitaire, aide aux réfugiés et promotion de la culture ukrainienne."
|
||||||
|
url="/"
|
||||||
|
/>
|
||||||
<AnimatedContent distance={60} direction="vertical" duration={1}>
|
<AnimatedContent distance={60} direction="vertical" duration={1}>
|
||||||
<div className="relative w-full h-[80vh] min-h-150 overflow-hidden mb-12 shadow-2xl group">
|
<div className="relative w-full h-[80vh] min-h-150 overflow-hidden mb-12 shadow-2xl group">
|
||||||
<img
|
<img
|
||||||
|
|||||||
Reference in New Issue
Block a user