Provide the option to remove the channel name from the sitemap location's path
Hi!
We are using your plugin at my company. Thank you for this plugin; it works like a charm 🌟!
Currently, we are using this plugin to generate our sitemap, and then write it to a bucket via Flysystem. However, the generated path includes the channel name, which is not relevant to us since we only have one channel on our Sylius setup, and this is unlikely to change in the future.
The following line in the GenerateSitemapCommand class is causing an issue:
$path = $this->path($channel, \sprintf('%s.xml', $provider->getName()));
This isn't a major problem, just a matter of perfectionism. On our bucket, we now have a directory with the channel name, which isn't optimal and can even be quite misleading.
At the moment, we don't see any easy fixes, aside from overriding the entire GenerateSitemapCommand class. Since the executeChannel function is private, we can't easily override it.
I'm not sure what the best solution for this problem is. Do you have any suggestions?
Thank you in advance for your response, and once again, thank you for this great plugin!
Hi @nina-alin!
Some days ago I tagged this release with support for Sylius 2.0: https://github.com/stefandoorn/sitemap-plugin/releases/tag/v3.0.0-alpha.1. It will be a new major version of this plugin, which also gives us some freedom to make 'breaking changes' to the plugin. The less the better, but anyhow we do have the ability now.
We might think about adding a service, that then get's injected into this command, which does the creation of the filename. Then it's easy to override/decorate the service, and implement your specific logic.
That does sound good to me from a SOLID perspective as well, to make the command do less things, and have specific services for specific tasks.
WDYT about that? I would be happy to accept a PR with such functionality, would you be able to provide that if you agree on this idea?
Thanks!