getConfig('baseUrl'); if (!$baseUrl) { echo "\nTo generate a sitemap.xml file, please specify a 'baseUrl' in config.php.\n\n"; return; } $sitemap = new Sitemap($jigsaw->getDestinationPath().'/sitemap.xml'); collect($jigsaw->getOutputPaths()) ->reject(function ($path) { return $this->isExcluded($path); })->each(function ($path) use ($baseUrl, $sitemap) { if (! Str::startsWith($path, '/')) { $path = '/' . $path; // Fix bug with `docs/v1` being present in getOutputPaths() } $sitemap->addItem(rtrim($baseUrl, '/').$path, time(), Sitemap::DAILY); }); $sitemap->write(); } public function isExcluded($path) { return Str::is($this->exclude, $path); } }