Skip to content
A symfony bundle for thepixeldeveloper/sitemap
PHP Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
tests
.gitattributes
.gitignore
.gitlab-ci.yml
CHANGELOG.md
LICENSE
Makefile
README.md
composer.json
docker-compose.yml
phpstan.neon
phpunit.xml

README.md

Thepixeldeveloper\SitemapBundle

pipeline status coverage report License Latest Stable Version Total Downloads

A symfony bundle that integrates thepixeldeveloper/sitemap.

Installation

  1. Require as a composer dependency:

    composer require "thepixeldeveloper/sitemap-bundle"
  2. Register the bundle:

    # app/AppKernel.php
    public function registerBundles()
    {
        $bundles = [
            new Thepixeldeveloper\SitemapBundle\ThepixeldeveloperSitemapBundle(),
        ];
    }
  3. Import routing

    # app/config/routing.yml
    thepixeldeveloper_sitemap_bundle:
        resource: "@ThepixeldeveloperSitemapBundle/Resources/config/routing.yml"
        prefix:   /
  4. Define where the XML files will be dumped.

    thepixeldeveloper_sitemap:
        directory: '%kernel.project_dir%/var/sitemaps'

Usage

  1. Create an event listener for theixeldeveloper_sitemap.populate. Add Urls to the Urlset collection.

  2. Sitemaps are generated as follows:

    ./bin/console thepixedeveloper:sitemap:dump
  3. Your sitemap will be accessible at: https://domain.tld/sitemap.xml

You can’t perform that action at this time.