thepixeldeveloper / sitemap-bundle
A Symfony Bundle that integrates thepixeldeveloper/sitemap.
3.0.6
2018-06-25 12:41 UTC
Requires
- php: >=7.0
- symfony/console: ^3|^4
- symfony/framework-bundle: ^3|^4
- symfony/yaml: ^3|^4
- thepixeldeveloper/sitemap: ^5
Requires (Dev)
README
A symfony bundle that integrates thepixeldeveloper/sitemap.
Installation
-
Require as a composer dependency:
composer require "thepixeldeveloper/sitemap-bundle"
-
Register the bundle:
# app/AppKernel.php public function registerBundles() { $bundles = [ new Thepixeldeveloper\SitemapBundle\ThepixeldeveloperSitemapBundle(), ]; }
-
Import routing
# app/config/routing.yml thepixeldeveloper_sitemap_bundle: resource: "@ThepixeldeveloperSitemapBundle/Resources/config/routing.yml" prefix: /
-
Define where the XML files will be dumped.
thepixeldeveloper_sitemap: directory: '%kernel.project_dir%/var/sitemaps'
Usage
-
Create an event listener for
theixeldeveloper_sitemap.populate
. Add Urls to the Urlset collection. -
Sitemaps are generated as follows:
./bin/console thepixedeveloper:sitemap:dump
-
Your sitemap will be accessible at: https://domain.tld/sitemap.xml