mirror of
https://github.com/arthur-pbty/hub.git
synced 2026-06-03 15:07:28 +02:00
feat: ajouter des scripts Google Ads et Matomo Analytics dans le layout
This commit is contained in:
+76
-28
@@ -2,6 +2,7 @@ import type { Metadata } from "next";
|
|||||||
import { Geist, Geist_Mono } from "next/font/google";
|
import { Geist, Geist_Mono } from "next/font/google";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import JsonLd from "@/components/JsonLd";
|
import JsonLd from "@/components/JsonLd";
|
||||||
|
import Script from "next/script";
|
||||||
import "./globals.css";
|
import "./globals.css";
|
||||||
|
|
||||||
const geistSans = Geist({
|
const geistSans = Geist({
|
||||||
@@ -16,11 +17,13 @@ const geistMono = Geist_Mono({
|
|||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "ArthurP.fr – Hub de projets et outils",
|
title: "ArthurP.fr – Hub de projets et outils",
|
||||||
description: "Découvre tous les outils, bots Discord, QCM, générateurs et ressources créés par ArthurP. Un point d’accès unique pour tout ce que je développe et partage.",
|
description:
|
||||||
|
"Découvre tous les outils, bots Discord, QCM, générateurs et ressources créés par ArthurP. Un point d’accès unique pour tout ce que je développe et partage.",
|
||||||
metadataBase: new URL("https://arthurp.fr"),
|
metadataBase: new URL("https://arthurp.fr"),
|
||||||
openGraph: {
|
openGraph: {
|
||||||
title: "ArthurP.fr – Hub de projets et outils",
|
title: "ArthurP.fr – Hub de projets et outils",
|
||||||
description: "Découvre tous les outils, bots Discord, QCM, générateurs et ressources créés par ArthurP.",
|
description:
|
||||||
|
"Découvre tous les outils, bots Discord, QCM, générateurs et ressources créés par ArthurP.",
|
||||||
url: "https://arthurp.fr",
|
url: "https://arthurp.fr",
|
||||||
siteName: "ArthurP.fr",
|
siteName: "ArthurP.fr",
|
||||||
locale: "fr_FR",
|
locale: "fr_FR",
|
||||||
@@ -29,7 +32,8 @@ export const metadata: Metadata = {
|
|||||||
twitter: {
|
twitter: {
|
||||||
card: "summary_large_image",
|
card: "summary_large_image",
|
||||||
title: "ArthurP.fr – Hub de projets et outils",
|
title: "ArthurP.fr – Hub de projets et outils",
|
||||||
description: "Découvre tous les outils, bots Discord, QCM, générateurs et ressources créés par ArthurP.",
|
description:
|
||||||
|
"Découvre tous les outils, bots Discord, QCM, générateurs et ressources créés par ArthurP.",
|
||||||
},
|
},
|
||||||
robots: {
|
robots: {
|
||||||
index: true,
|
index: true,
|
||||||
@@ -44,14 +48,33 @@ export default function RootLayout({
|
|||||||
}>) {
|
}>) {
|
||||||
return (
|
return (
|
||||||
<html lang="fr">
|
<html lang="fr">
|
||||||
<head>
|
<body
|
||||||
<script
|
className={`${geistSans.variable} ${geistMono.variable} antialiased bg-white text-zinc-900`}
|
||||||
|
>
|
||||||
|
{/* Ads (Google) */}
|
||||||
|
<Script
|
||||||
async
|
async
|
||||||
src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6938358002331071"
|
src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6938358002331071"
|
||||||
crossOrigin="anonymous"
|
crossOrigin="anonymous"
|
||||||
></script>
|
/>
|
||||||
</head>
|
|
||||||
<body className={`${geistSans.variable} ${geistMono.variable} antialiased bg-white text-zinc-900`}>
|
{/* Matomo Analytics */}
|
||||||
|
<Script id="matomo" strategy="afterInteractive">
|
||||||
|
{`
|
||||||
|
var _paq = window._paq = window._paq || [];
|
||||||
|
_paq.push(['trackPageView']);
|
||||||
|
_paq.push(['enableLinkTracking']);
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
var u="https://analytics.arthurp.fr/";
|
||||||
|
_paq.push(['setTrackerUrl', u+'matomo.php']);
|
||||||
|
_paq.push(['setSiteId', '1']);
|
||||||
|
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||||
|
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
|
||||||
|
})();
|
||||||
|
`}
|
||||||
|
</Script>
|
||||||
|
|
||||||
<JsonLd
|
<JsonLd
|
||||||
data={{
|
data={{
|
||||||
"@context": "https://schema.org",
|
"@context": "https://schema.org",
|
||||||
@@ -68,48 +91,73 @@ export default function RootLayout({
|
|||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div className="min-h-screen flex flex-col">
|
<div className="min-h-screen flex flex-col">
|
||||||
<div className="flex-1">
|
<div className="flex-1">{children}</div>
|
||||||
{children}
|
|
||||||
</div>
|
|
||||||
<footer className="w-full border-t border-zinc-200 bg-zinc-50">
|
<footer className="w-full border-t border-zinc-200 bg-zinc-50">
|
||||||
<div className="mx-auto grid max-w-6xl grid-cols-1 gap-10 px-6 py-12 text-sm text-zinc-600 md:grid-cols-3">
|
<div className="mx-auto grid max-w-6xl grid-cols-1 gap-10 px-6 py-12 text-sm text-zinc-600 md:grid-cols-3">
|
||||||
<div>
|
<div>
|
||||||
<h2 className="text-base font-semibold text-zinc-900">Navigation</h2>
|
<h2 className="text-base font-semibold text-zinc-900">
|
||||||
<nav aria-label="Navigation principale" className="mt-4 flex flex-col gap-2">
|
Navigation
|
||||||
<Link href="/" className="hover:text-zinc-900 hover:underline">Accueil</Link>
|
</h2>
|
||||||
<Link href="/#projets" className="hover:text-zinc-900 hover:underline">Projets</Link>
|
<nav className="mt-4 flex flex-col gap-2">
|
||||||
<a href="https://contact.arthurp.fr" target="_blank" rel="noopener noreferrer" className="hover:text-zinc-900 hover:underline">Contact</a>
|
<Link href="/">Accueil</Link>
|
||||||
|
<Link href="/#projets">Projets</Link>
|
||||||
|
<a
|
||||||
|
href="https://contact.arthurp.fr"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
Contact
|
||||||
|
</a>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<h2 className="text-base font-semibold text-zinc-900">ArthurP.fr</h2>
|
<h2 className="text-base font-semibold text-zinc-900">
|
||||||
|
ArthurP.fr
|
||||||
|
</h2>
|
||||||
<div className="mt-4 flex flex-col gap-2">
|
<div className="mt-4 flex flex-col gap-2">
|
||||||
<a href="https://arthurp.fr" target="_blank" rel="noopener noreferrer" className="hover:text-zinc-900 hover:underline">arthurp.fr</a>
|
<a
|
||||||
<a href="https://github.com/arthur-pbty" target="_blank" rel="noopener noreferrer" className="hover:text-zinc-900 hover:underline">GitHub</a>
|
href="https://arthurp.fr"
|
||||||
<a href="mailto:contact@arthurp.fr" className="hover:text-zinc-900 hover:underline">contact@arthurp.fr</a>
|
target="_blank"
|
||||||
<a href="https://contact.arthurp.fr" target="_blank" rel="noopener noreferrer" className="hover:text-zinc-900 hover:underline">contact.arthurp.fr</a>
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
arthurp.fr
|
||||||
|
</a>
|
||||||
|
<a
|
||||||
|
href="https://github.com/arthur-pbty"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
GitHub
|
||||||
|
</a>
|
||||||
|
<a href="mailto:contact@arthurp.fr">contact@arthurp.fr</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<h2 className="text-base font-semibold text-zinc-900">Légal</h2>
|
<h2 className="text-base font-semibold text-zinc-900">
|
||||||
<nav aria-label="Liens légaux" className="mt-4 flex flex-col gap-2">
|
Légal
|
||||||
<Link href="/legal/mentions-legales" className="hover:text-zinc-900 hover:underline">Mentions légales</Link>
|
</h2>
|
||||||
<Link href="/legal/confidentialite" className="hover:text-zinc-900 hover:underline">Confidentialité</Link>
|
<nav className="mt-4 flex flex-col gap-2">
|
||||||
<Link href="/legal/cgu" className="hover:text-zinc-900 hover:underline">CGU</Link>
|
<Link href="/legal/mentions-legales">Mentions légales</Link>
|
||||||
|
<Link href="/legal/confidentialite">Confidentialité</Link>
|
||||||
|
<Link href="/legal/cgu">CGU</Link>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="border-t border-zinc-200 px-6 py-5 text-center text-sm text-zinc-500">
|
<div className="border-t border-zinc-200 px-6 py-5 text-center text-sm text-zinc-500">
|
||||||
<p>© {new Date().getFullYear()} Arthur P. Tous droits réservés.</p>
|
<p>© {new Date().getFullYear()} Arthur P. Tous droits réservés.</p>
|
||||||
<p className="mt-1">Fait avec passion et auto-hébergé sur Proxmox.</p>
|
<p className="mt-1">
|
||||||
|
Fait avec passion et auto-hébergé sur Proxmox.
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user