@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | { |
| 35 | 35 | $sitemap = new Sitemap($this->jigsaw->getDestinationPath() . '/sitemap.xml'); |
| 36 | 36 | |
| 37 | - collect($this->jigsaw->getOutputPaths())->each(function ($path) use ($baseUrl, $sitemap) { |
|
| 37 | + collect($this->jigsaw->getOutputPaths())->each(function($path) use ($baseUrl, $sitemap) { |
|
| 38 | 38 | // Don't index assets |
| 39 | 39 | if (!$this->isAsset($path) && !$this->isExcluded($path)) { |
| 40 | 40 | // Check if a file extension is present |
@@ -53,9 +53,9 @@ discard block |
||
| 53 | 53 | { |
| 54 | 54 | $sitemap = new Sitemap($this->jigsaw->getDestinationPath() . '/' . ($this->jigsaw->getConfig('sitemap.image_sitemap.filename') ?: 'sitemap_images.xml')); |
| 55 | 55 | $exts = $this->jigsaw->getConfig('sitemap.image_sitemap.extensions'); |
| 56 | - $supported_extensions = $exts ? $exts->toArray() : []; |
|
| 56 | + $supported_extensions = $exts ? $exts->toArray() : [ ]; |
|
| 57 | 57 | |
| 58 | - collect($this->jigsaw->getOutputPaths())->each(function ($path) use ($baseUrl, $sitemap, $supported_extensions) { |
|
| 58 | + collect($this->jigsaw->getOutputPaths())->each(function($path) use ($baseUrl, $sitemap, $supported_extensions) { |
|
| 59 | 59 | // Don't index assets |
| 60 | 60 | if ($this->isAsset($path) && !$this->isExcluded($path)) { |
| 61 | 61 | // Check if a file extension is present |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | private function isExcluded($path) |
| 72 | 72 | { |
| 73 | 73 | $excluded = $this->jigsaw->getConfig('sitemap.exclude'); |
| 74 | - $invalidAssets = $excluded ? $excluded->toArray() : []; |
|
| 74 | + $invalidAssets = $excluded ? $excluded->toArray() : [ ]; |
|
| 75 | 75 | return Str::contains($path, $invalidAssets); |
| 76 | 76 | } |
| 77 | 77 | |
@@ -60,8 +60,9 @@ |
||
| 60 | 60 | if ($this->isAsset($path) && !$this->isExcluded($path)) { |
| 61 | 61 | // Check if a file extension is present |
| 62 | 62 | $ext = strtolower(pathinfo($path, PATHINFO_EXTENSION)); |
| 63 | - if (in_array($ext, $supported_extensions)) |
|
| 64 | - $sitemap->addItem(rtrim($baseUrl, '/') . $path, time(), Sitemap::MONTHLY); |
|
| 63 | + if (in_array($ext, $supported_extensions)) { |
|
| 64 | + $sitemap->addItem(rtrim($baseUrl, '/') . $path, time(), Sitemap::MONTHLY); |
|
| 65 | + } |
|
| 65 | 66 | } |
| 66 | 67 | }); |
| 67 | 68 | |