nouvelletechno / sitemap-bundle
This bundle helps you generating a sitemap.xml file for your Symfony application
Installs: 19
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^7.2.5
- doctrine/orm: ^2.7
- symfony/dependency-injection: ^4.3 || ^5.0
- symfony/framework-bundle: ^4.3 || ^5.0
- symfony/http-foundation: ^4.3 || ^5.0
- symfony/http-kernel: ^4.3 || ^5.0
- symfony/routing: ^4.3 || ^5.0
- symfony/twig-bridge: ^4.3 || ^5.0
- symfony/twig-bundle: ^4.3 || ^5.0
- symfony/yaml: ^4.3 || ^5.0
README
Bundle that generates dynamic sitemap.xml content with simple yaml configuration.
Installation
# composer require NouvelleTechno/sitemap-bundle
Update your routing
Add a sitemap.yaml
file inside config/routes
and include the below content to enable new route
sitemap: resource: '@SitemapBundle/Controller/SitemapController.php' type: annotation
The bundle will then listen to /sitemap.xml
and generate the sitemap by itself
Usage
The bundle generates a sitemap based on YAML configuration.
Add a sitemap.yaml
file inside config/packages
and customize the below example to enable your sitemap
sitemap: routes: # List here the different routes you want to include in the sitemap # Single route without parameters - { route: 'demos_index' } # Route that requires parameters - { route: 'demos_show', entity: 'Demos', parameters: 'id' } # Route with priority and frequency # Priority between 0 and 1 # Frequency should be 'always', 'hourly', 'daily', 'weekly', 'monthly', 'yearly' or 'never' - { route: 'demos_show', entity: 'Demos', parameters: 'id', frequency: 'monthly', priority: 0.5 }