PHP code example of clivewalkden / jigsaw-sitemap

1. Go to this page and download the library: Download clivewalkden/jigsaw-sitemap library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

clivewalkden / jigsaw-sitemap example snippets


use CliveWalkden\JigsawSitemap\SitemapListener;

/**
 * An afterBuild event is fired after the build is complete, and all output files
 * have been written to the build directory. This allows you to obtain a list of
 * the output file paths (to use, for example, when creating a sitemap.xml file),
 * programmatically create output files, or take care of any other post-processing tasks.
 *
 * @link http://jigsaw.tighten.co/docs/event-listeners/
 */
$events->afterBuild([
    SitemapListener::class,
]);

'sitemap' => [
    'url_trailing_slash' => true,
    'exclude' => [
        '.htaccess',
        'favicon.ico',
        // ...
    ],
    'image_sitemap' => [
        'generate' => true,
        'filename' => 'sitemap_images.xml',
        'extensions' => [
            'gif',
            'jpg',
            'jpeg',
            'png',
            // ...
        ]
    ]
],