diff --git a/ux.symfony.com/src/Controller/ChangelogController.php b/ux.symfony.com/src/Controller/ChangelogController.php index 6844575bfb7..c9145de745f 100644 --- a/ux.symfony.com/src/Controller/ChangelogController.php +++ b/ux.symfony.com/src/Controller/ChangelogController.php @@ -13,6 +13,7 @@ use App\Service\Changelog\ChangelogProvider; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; +use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Attribute\Route; @@ -32,4 +33,32 @@ public function __invoke(): Response 'changelog' => $changelog, ]); } + + #[Route('/changelog/{version}', name: 'app_changelog_version')] + public function tag(Request $request): Response + { + $changelog = $this->changeLogProvider->getChangelog(); + + foreach ($changelog as $version) { + if ($version['version'] === $request->get('version')) { + break; + } + $version = null; + } + + if (!isset($version)) { + throw $this->createNotFoundException('Version not found'); + } + + if ($turboFrame = $request->headers->has('Turbo-Frame')) { + return $this->renderBlock('changelog/changelog_version.html.twig', 'version', [ + 'version' => $version, + ]); + } + + return $this->render('changelog/changelog_version.html.twig', [ + 'version' => $version, + 'changelog' => $changelog, + ]); + } } diff --git a/ux.symfony.com/templates/changelog.html.twig b/ux.symfony.com/templates/changelog.html.twig index 8e3a3af9106..116e385933e 100644 --- a/ux.symfony.com/templates/changelog.html.twig +++ b/ux.symfony.com/templates/changelog.html.twig @@ -15,6 +15,29 @@
New features, bug fixes, performances and security improvements.
+ +New features, bug fixes, performances and security improvements.
+