- Homepage: hero, how it works (buyer/organizer), features, CTA
- Tarifs: 3 plans (Gratuit, Basique 10€, Sur-mesure), JSON-LD Product
- Legal pages: mentions legales, CGU (tabs buyer/organizer), CGV, RGPD, cookies, hosting
- Navbar: neubrutalism style, logo liip, mobile menu, SEO attributes
- Footer: contact, description, legal links, tarifs
- Sitemap: add /tarifs and /sitemap-orgas-{page}.xml
- Liip Imagine: remove S3, webp format on all filters
- Tests: full coverage for all controllers, services, repositories
- Fix CSP: replace inline onclick with data-tab JS
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
97 lines
3.1 KiB
PHP
97 lines
3.1 KiB
PHP
<?php
|
|
|
|
namespace App\Controller;
|
|
|
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|
use Symfony\Component\HttpFoundation\Response;
|
|
use Symfony\Component\Routing\Attribute\Route;
|
|
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
|
|
|
class SitemapController extends AbstractController
|
|
{
|
|
private const MAX_URLS_PER_SITEMAP = 50000;
|
|
private const CONTENT_TYPE_XML = 'text/xml';
|
|
|
|
#[Route('/sitemap.xml', name: 'app_sitemap', methods: ['GET'])]
|
|
public function index(): Response
|
|
{
|
|
$eventPages = max(1, (int) ceil(0 / self::MAX_URLS_PER_SITEMAP));
|
|
|
|
$sitemaps = [
|
|
['loc' => $this->generateUrl('app_sitemap_main', [], UrlGeneratorInterface::ABSOLUTE_URL)],
|
|
];
|
|
|
|
$orgaPages = max(1, (int) ceil(0 / self::MAX_URLS_PER_SITEMAP));
|
|
|
|
for ($i = 1; $i <= $eventPages; ++$i) {
|
|
$sitemaps[] = [
|
|
'loc' => $this->generateUrl('app_sitemap_events', ['page' => $i], UrlGeneratorInterface::ABSOLUTE_URL),
|
|
];
|
|
}
|
|
|
|
for ($i = 1; $i <= $orgaPages; ++$i) {
|
|
$sitemaps[] = [
|
|
'loc' => $this->generateUrl('app_sitemap_orgas', ['page' => $i], UrlGeneratorInterface::ABSOLUTE_URL),
|
|
];
|
|
}
|
|
|
|
return new Response(
|
|
$this->renderView('sitemap/index.xml.twig', ['sitemaps' => $sitemaps]),
|
|
200,
|
|
['Content-Type' => self::CONTENT_TYPE_XML],
|
|
);
|
|
}
|
|
|
|
#[Route('/sitemap-main.xml', name: 'app_sitemap_main', methods: ['GET'])]
|
|
public function main(): Response
|
|
{
|
|
$urls = [
|
|
[
|
|
'loc' => $this->generateUrl('app_home', [], UrlGeneratorInterface::ABSOLUTE_URL),
|
|
'changefreq' => 'daily',
|
|
'priority' => '1.0',
|
|
],
|
|
[
|
|
'loc' => $this->generateUrl('app_search', [], UrlGeneratorInterface::ABSOLUTE_URL),
|
|
'changefreq' => 'weekly',
|
|
'priority' => '0.5',
|
|
],
|
|
[
|
|
'loc' => $this->generateUrl('app_tarifs', [], UrlGeneratorInterface::ABSOLUTE_URL),
|
|
'changefreq' => 'monthly',
|
|
'priority' => '0.7',
|
|
],
|
|
];
|
|
|
|
return new Response(
|
|
$this->renderView('sitemap/urlset.xml.twig', ['urls' => $urls]),
|
|
200,
|
|
['Content-Type' => self::CONTENT_TYPE_XML],
|
|
);
|
|
}
|
|
|
|
#[Route('/sitemap-events-{page}.xml', name: 'app_sitemap_events', requirements: ['page' => '\d+'], methods: ['GET'])]
|
|
public function events(int $page = 1): Response
|
|
{
|
|
$urls = [];
|
|
|
|
return new Response(
|
|
$this->renderView('sitemap/urlset.xml.twig', ['urls' => $urls]),
|
|
200,
|
|
['Content-Type' => self::CONTENT_TYPE_XML],
|
|
);
|
|
}
|
|
|
|
#[Route('/sitemap-orgas-{page}.xml', name: 'app_sitemap_orgas', requirements: ['page' => '\d+'], methods: ['GET'])]
|
|
public function orgas(int $page = 1): Response
|
|
{
|
|
$urls = [];
|
|
|
|
return new Response(
|
|
$this->renderView('sitemap/urlset.xml.twig', ['urls' => $urls]),
|
|
200,
|
|
['Content-Type' => self::CONTENT_TYPE_XML],
|
|
);
|
|
}
|
|
}
|