SEO: canonical, sitemap.xml, robots.txt, JSON-LD, noindex admin

This commit is contained in:
Cedric Abonnel
2026-05-12 01:19:38 +02:00
parent ca6fcefe51
commit 3a5ae2631d
7 changed files with 139 additions and 3 deletions
+24
View File
@@ -90,4 +90,28 @@ ob_start();
<?php
$content = ob_get_clean();
$title = 'varlog';
// Pages avec curseur = contenu non-canonique → noindex
if (!empty($cursor)) {
$metaRobots = 'noindex, follow';
$canonical = rtrim(APP_URL, '/') . '/';
} elseif ($filterCat !== '') {
$canonical = rtrim(APP_URL, '/') . '/?' . http_build_query(['cat' => $filterCat]);
} else {
$canonical = rtrim(APP_URL, '/') . '/';
}
// JSON-LD WebSite sur la page d'accueil sans filtre
if (empty($cursor) && $filterCat === '') {
$jsonLd = json_encode([
'@context' => 'https://schema.org',
'@type' => 'WebSite',
'name' => 'varlog',
'url' => rtrim(APP_URL, '/') . '/',
'description' => 'Journal personnel de Cédrix. Informatique, hack et loisirs techniques.',
'inLanguage' => 'fr-FR',
'author' => ['@type' => 'Person', 'name' => 'Cédrix'],
], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
}
include __DIR__ . '/layout.php';