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.

+ +
+
+
+

Versions

+ +
+
+ + ... + +
+
+
diff --git a/ux.symfony.com/templates/changelog/changelog_version.html.twig b/ux.symfony.com/templates/changelog/changelog_version.html.twig new file mode 100644 index 00000000000..d0a466a727a --- /dev/null +++ b/ux.symfony.com/templates/changelog/changelog_version.html.twig @@ -0,0 +1,44 @@ +{% extends 'base.html.twig' %} + +{% set meta = { + title: 'Changelog', + title_suffix: ' - Symfony UX', + description: 'Symfony UX changelog - New features, bug fixes, performances and security improvements about Symfony Live Components, Twig Components, Autocomplete, Icons...', + canonical: url('app_changelog'), +} %} + +{% block content %} + +
+
+

Changelog

+

New features, bug fixes, performances and security improvements.

+
+
+ +
+
+
+

Versions

+ +
+
+ {% block version %} + + + + {% endblock %} +
+
+
+ +{% endblock %}