Skip to content

Installation

phil/sitemap-bundle

Requirements

PackageVersionUsed for
PHP8.5 or later, with zlib--gzip
phil/sitemap^0.1The pages, the sections and files, the XML
symfony/routing, symfony/http-foundation, symfony/http-kernel^8.2The route option, the served sitemap
symfony/console^8.2phil:sitemap:dump
symfony/clock, psr/clocklastmod: now
psr/event-dispatcher^1.0PopulateSitemap
symfony/config, symfony/dependency-injection^8.2The configuration and the services

Registering

// config/bundles.php
return [
    // ...
    Phil\SitemapBundle\PhilSitemapBundle::class => ['all' => true],
];

Routes

The served sitemap needs the bundle's routes; a site that only dumps its sitemap can leave them out.

# config/routes/phil_sitemap.yaml
phil_sitemap:
    resource: '@PhilSitemapBundle/config/routes.php'
RoutePath
phil_sitemap_index/sitemap.xml
phil_sitemap_file/sitemap.{name}.xml

A site whose web server serves the dumped files from public/ has them answer first: Symfony is not reached.