```
✨ feat(sitemap): Ajoute une commande pour générer les sitemaps et modifie l'appel dans ansible.
```
This commit is contained in:
@@ -216,7 +216,7 @@
|
||||
args:
|
||||
chdir: "{{ path }}"
|
||||
- name: Exécuter pwa:compile dans le répertoire de l application
|
||||
ansible.builtin.command: php bin/console presta:sitemaps:dump
|
||||
ansible.builtin.command: php bin/console app:sitemap
|
||||
become: false
|
||||
args:
|
||||
chdir: "{{ path }}"
|
||||
|
||||
@@ -6,7 +6,11 @@ controllers:
|
||||
type: attribute
|
||||
|
||||
|
||||
|
||||
PrestaSitemapBundle_section:
|
||||
path: "/seo/%presta_sitemap.sitemap_file_prefix%.{name}.{_format}"
|
||||
defaults: { _controller: Presta\SitemapBundle\Controller\SitemapController::sectionAction }
|
||||
requirements:
|
||||
_format: xml
|
||||
|
||||
2fa_login:
|
||||
path: /2fa
|
||||
|
||||
32
src/Command/SitemapCommand.php
Normal file
32
src/Command/SitemapCommand.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Command;
|
||||
|
||||
|
||||
use Presta\SitemapBundle\Service\DumperInterface;
|
||||
use Symfony\Component\Console\Attribute\AsCommand;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
use Symfony\Component\Routing\RouterInterface;
|
||||
|
||||
#[AsCommand(name: 'app:sitemap', description: 'Dumps sitemaps to given location')]
|
||||
class SitemapCommand extends Command
|
||||
{
|
||||
public function __construct(private readonly KernelInterface $kernel,private readonly DumperInterface $dumper,?string $name = null)
|
||||
{
|
||||
parent::__construct($name);
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
$this->dumper->dump($this->kernel->getProjectDir()."/public/seo",$_ENV['DEFAULT_URI']."/seo","",[]);
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user