mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-03-31 17:15:38 +00:00
implement sitemap
This commit is contained in:
parent
d3cdbc831c
commit
891868eccd
2 changed files with 50 additions and 0 deletions
|
|
@ -1884,6 +1884,41 @@ class TorrentController extends AbstractController
|
|||
return new Response(); // @TODO
|
||||
}
|
||||
|
||||
#[Route(
|
||||
'/sitemap.xml',
|
||||
methods:
|
||||
[
|
||||
'GET'
|
||||
]
|
||||
)]
|
||||
public function sitemap(
|
||||
TorrentService $torrentService
|
||||
): Response
|
||||
{
|
||||
$locale = $this->getParameter('app.locale');
|
||||
$locales = explode('|', $this->getParameter('app.locales'));
|
||||
|
||||
$response = new Response();
|
||||
$response->headers->set('Content-Type', 'text/xml');
|
||||
|
||||
return $this->render(
|
||||
'default/torrent/sitemap.xml.twig',
|
||||
[
|
||||
'locale' => $locale,
|
||||
'locales' => $locales,
|
||||
'torrents' => $torrentService->findTorrents(
|
||||
[], // without keywords filter
|
||||
$locales, // all sensitive levels
|
||||
null, // all sensitive levels
|
||||
true, // approved only
|
||||
1000, // @TODO limit
|
||||
0 // offset
|
||||
)
|
||||
],
|
||||
$response
|
||||
);
|
||||
}
|
||||
|
||||
private function initUser(
|
||||
Request $request,
|
||||
UserService $userService,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue