feat: Ajoute l'URL de la page d'accueil au sitemap
This commit is contained in:
@@ -8,15 +8,19 @@ use Presta\SitemapBundle\Event\SitemapPopulateEvent;
|
||||
use Presta\SitemapBundle\Service\UrlContainerInterface;
|
||||
use Presta\SitemapBundle\Sitemap\Url\UrlConcrete;
|
||||
|
||||
class SitemapSubscriber implements EventSubscriberInterface {
|
||||
class SitemapSubscriber implements EventSubscriberInterface
|
||||
{
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return [
|
||||
SitemapPopulateEvent::class => 'populate',
|
||||
];
|
||||
}
|
||||
public function populate(SitemapPopulateEvent $event): void
|
||||
public function populate(SitemapPopulateEvent $sitemapPopulateEvent): void
|
||||
{
|
||||
|
||||
$urlContainer = $sitemapPopulateEvent->getUrlContainer();
|
||||
$urlGenerator = $sitemapPopulateEvent->getUrlGenerator();
|
||||
$pathMenuItem = new UrlConcrete($urlGenerator->generate('root',[], UrlGeneratorInterface::ABSOLUTE_URL));
|
||||
$urlContainer->addUrl($pathMenuItem, 'main');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,13 +67,13 @@ class ViteAssetExtension extends AbstractExtension
|
||||
$html = <<<HTML
|
||||
<script type="module" src="/build/{$file}" defer></script>
|
||||
HTML;
|
||||
foreach($css as $cssFile) {
|
||||
foreach ($css as $cssFile) {
|
||||
$html .= <<<HTML
|
||||
<link rel="stylesheet" media="screen" href="/build/{$cssFile}"/>
|
||||
HTML;
|
||||
}
|
||||
|
||||
foreach($imports as $import) {
|
||||
foreach ($imports as $import) {
|
||||
$html .= <<<HTML
|
||||
<link rel="modulepreload" href="/assets/{$import}"/>
|
||||
HTML;
|
||||
|
||||
Reference in New Issue
Block a user