Skip to content

Commit

Permalink
Merge pull request #121 from rix-fr/blog-sitemap
Browse files Browse the repository at this point in the history
[Blog] enable sitemap
  • Loading branch information
gfaivre authored Oct 30, 2023
2 parents 57929a7 + fd2d0a6 commit f6c3eeb
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions src/Controller/BlogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ public function __construct(ContentManagerInterface $manager)
$this->manager = $manager;
}

#[Route(name: 'blog',
// TODO: remove options.stenope.sitemap: false when blog is ready
options: ['stenope' => ['sitemap' => false]]),
]
#[Route(name: 'blog')]
#[Route('/page/{!page}', name: 'blog_page', requirements: ['page' => '\d+'])]
public function index(int $page = 1, int $perPage = 10): Response
{
Expand All @@ -39,14 +36,8 @@ public function index(int $page = 1, int $perPage = 10): Response
])->setLastModified(\count($pageArticles) > 0 ? ContentUtils::max($pageArticles, 'lastModifiedOrCreated') : null);
}

#[Route('/tag/{tag}', name: 'blog_tag',
// TODO: remove options.stenope.ignore when blog is ready
options: ['stenope' => ['ignore' => true]]),
]
#[Route('/tag/{tag}/{!page}', name: 'blog_tag_page', requirements: ['page' => '\d+'],
// TODO: remove options.stenope.ignore when blog is ready
options: ['stenope' => ['ignore' => true]]),
]
#[Route('/tag/{tag}', name: 'blog_tag')]
#[Route('/tag/{tag}/{!page}', name: 'blog_tag_page', requirements: ['page' => '\d+'])]
public function tag(string $tag, int $page = 1, int $perPage = 20): Response
{
$articles = $this->manager->getContents(
Expand All @@ -66,10 +57,7 @@ public function tag(string $tag, int $page = 1, int $perPage = 20): Response
])->setLastModified(\count($pageArticles) > 0 ? ContentUtils::max($pageArticles, 'lastModifiedOrCreated') : null);
}

#[Route('/{article}', name: 'blog_article', requirements: ['article' => '.+'],
// TODO: remove options.stenope.sitemap: false when blog is ready
options: ['stenope' => ['sitemap' => false]])
]
#[Route('/{article}', name: 'blog_article', requirements: ['article' => '.+'])]
public function article(Article $article): Response
{
return $this->render('blog/article.html.twig', [
Expand Down

0 comments on commit f6c3eeb

Please sign in to comment.