release 2.0.1 k8s convenience output file option

This commit is contained in:
Jérémy Munsch 2024-02-12 16:10:14 +01:00
parent 482614655c
commit a982d5daa1
No known key found for this signature in database
GPG key ID: 18361AF3BFEC0FEC
3 changed files with 13 additions and 2 deletions

View file

@ -2,6 +2,10 @@
All notable changes to `sitemap-generator` will be documented in this file.
## Version 2.0.1
- Add sitemap output option
## Version 2.0.0
- Laravel 10 php 8.2 release

View file

@ -96,4 +96,11 @@ return [
* ! This needs pupetter installed with npm : npm i puppeteer (not to put in dev dependencies)
*/
'executeJavascript' => true,
/**
* Output xml file, consider this shall be public/sitemap.xml
*
* Use this for deployement convenience for example.
*/
'output' => \storage_path('app/public/sitemap.xml')
];

View file

@ -47,13 +47,13 @@ class GenerateSitemapCommand extends Command
return 0;
}
$dest = \public_path('sitemap.xml');
$dest = config('sitemap-generator.output', \public_path('sitemap.xml'));
if (File::exists($dest)) {
$this->info('public/sitemap.xml exist, will overwrite.');
}
$sitemap->export(\public_path('sitemap.xml'));
$sitemap->export($dest);
} catch (SitemapException $e) {
$this->error('An error occured while generating sitemap');
$this->error($e->getMessage());