From a982d5daa165f697b2ff1559a3558f48f0d11047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Mon, 12 Feb 2024 16:10:14 +0100 Subject: [PATCH] release 2.0.1 k8s convenience output file option --- changelog.md | 4 ++++ config/sitemap-generator.php | 7 +++++++ src/Console/Commands/GenerateSitemapCommand.php | 4 ++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index d57a4ef..79bbe85 100644 --- a/changelog.md +++ b/changelog.md @@ -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 diff --git a/config/sitemap-generator.php b/config/sitemap-generator.php index 8bbde90..a9adc7f 100644 --- a/config/sitemap-generator.php +++ b/config/sitemap-generator.php @@ -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') ]; diff --git a/src/Console/Commands/GenerateSitemapCommand.php b/src/Console/Commands/GenerateSitemapCommand.php index 8ab89ec..12fd781 100644 --- a/src/Console/Commands/GenerateSitemapCommand.php +++ b/src/Console/Commands/GenerateSitemapCommand.php @@ -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());