thepixeldeveloper/sitemap-bundle

A Symfony Bundle that integrates thepixeldeveloper/sitemap.

3.0.6 2018-06-25 12:41 UTC

This package is not auto-updated.

Last update: 2024-11-24 04:16:48 UTC


README

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