Skip to content

Commit

Permalink
fix: correctly compress sitemap.xml (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkarlovi authored Dec 11, 2023
1 parent 8d37ffb commit ad67268
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ private function dumpSitemap(Sitemapindex|Urlset $sitemap, bool $deflate): void
}

/** @var string $content */
$content = $deflate ? gzdeflate($sitemap->toXml()) : $sitemap->toXml();
$content = ($deflate ? gzencode($sitemap->toXml()) : $sitemap->toXml());
$this->filesystem->dumpFile($this->buildDir.str_replace($this->generateUrl(''), '', $path), $content);
}
}
Binary file modified tests/functional/site/fixtures/sitemap-article-0.xml.gz
Binary file not shown.
Binary file modified tests/functional/site/fixtures/sitemap-articles-0.xml.gz
Binary file not shown.
Binary file modified tests/functional/site/fixtures/sitemap-file-0.xml.gz
Binary file not shown.
Binary file modified tests/functional/site/fixtures/sitemap-homepage-0.xml.gz
Binary file not shown.
Binary file modified tests/functional/site/fixtures/sitemap-index-0.xml.gz
Binary file not shown.
Binary file modified tests/functional/site/fixtures/sitemap-product-0.xml.gz
Binary file not shown.
Binary file not shown.
Binary file modified tests/functional/site/fixtures/sitemap.xml.gz
Binary file not shown.

0 comments on commit ad67268

Please sign in to comment.