1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 20:34:03 +00:00

Apply fixes from StyleCI

This commit is contained in:
stancl 2019-08-16 20:09:52 +00:00 committed by StyleCI Bot
parent a92690cea8
commit b43c8e1ea7
6 changed files with 29 additions and 30 deletions

View file

@ -10,27 +10,27 @@ class GenerateSitemap
protected $exclude = [
'/assets/*',
'*/favicon.ico',
'*/404'
'*/404',
];
public function handle(Jigsaw $jigsaw)
{
$baseUrl = $jigsaw->getConfig('baseUrl');
if (! $baseUrl) {
echo("\nTo generate a sitemap.xml file, please specify a 'baseUrl' in config.php.\n\n");
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');
$sitemap = new Sitemap($jigsaw->getDestinationPath().'/sitemap.xml');
collect($jigsaw->getOutputPaths())
->reject(function ($path) {
return $this->isExcluded($path);
})->each(function ($path) use ($baseUrl, $sitemap) {
$sitemap->addItem(rtrim($baseUrl, '/') . $path, time(), Sitemap::DAILY);
});
$sitemap->addItem(rtrim($baseUrl, '/').$path, time(), Sitemap::DAILY);
});
$sitemap->write();
}