Skip to content

Commit 5523546

Browse files
committed
[Site] Documentation index
1 parent 93027de commit 5523546

File tree

3 files changed

+85
-0
lines changed

3 files changed

+85
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace App\Controller;
13+
14+
use App\Service\UxPackageRepository;
15+
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
16+
use Symfony\Component\HttpFoundation\Response;
17+
use Symfony\Component\Routing\Attribute\Route;
18+
19+
class DocumentationController extends AbstractController
20+
{
21+
#[Route('/documentation', name: 'app_documentation')]
22+
public function __invoke(UxPackageRepository $packageRepository): Response
23+
{
24+
$packages = $packageRepository->findAll();
25+
usort($packages, fn ($a, $b) => $a->getHumanName() <=> $b->getHumanName());
26+
27+
return $this->render('documentation/index.html.twig', [
28+
'packages' => $packages,
29+
]);
30+
}
31+
}

ux.symfony.com/templates/_footer.html.twig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
>
1111
<twig:Icon name="github"/>
1212
</a>
13+
<a href="{{ url('app_documentation') }}" style="font-size: 11px; text-transform: uppercase;" class="order-lg-0">Docs</a>
1314
<a href="{{ url('app_changelog') }}" style="font-size: 11px; text-transform: uppercase;" class="order-lg-0">Changelog</a>
1415
<a href="https://symfony.com" rel="external noopener noreferrer"
1516
style="font-size: 1.5rem;"
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{% extends 'base.html.twig' %}
2+
3+
{% set meta = {
4+
title: 'Documentation',
5+
description: 'Symfony UX bundle and packages documentation',
6+
canonical: url('app_documentation'),
7+
} %}
8+
9+
{% block content %}
10+
<div class="hero">
11+
<div class="container-fluid container-xxl px-4 pt-4 px-md-5">
12+
<h1 class="text-center mt-5">Documentation</h1>
13+
<p class="text-center demo-introduction">
14+
Read full documentation on
15+
<a href="https://symfony.com/bundles#symfony-ux-bundles"><code>symfony.com</code></a>
16+
</p>
17+
</div>
18+
</div>
19+
20+
<section class="container-fluid container-xxl px-4 px-md-5 py-3">
21+
<div class="align-items-center text-md-start mb-4">
22+
<h2 class="ubuntu pt-2 component-headlines">Packages</h2>
23+
</div>
24+
<div
25+
style="display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));">
26+
{% for package in packages %}
27+
<div class="PackageBox" style="--gradient: {{ package.gradient }};--color: {{ package.color }};">
28+
<div class="PackageBox_logo" style="--logo-size: 4rem;">
29+
<img width="36" height="36" src="{{ asset('images/ux_packages/' ~ package.imageFilename) }}"
30+
alt="Image for the {{ package.humanName }} UX package">
31+
</div>
32+
<div class="PackageBox_content">
33+
<h3 class="PackageBox_title" style="font-size: 1.25rem;">
34+
<a href="{{ path(package.route) }}">{{ package.humanName }}</a>
35+
</h3>
36+
<a href="{{ package.officialDocsUrl }}" class="PackageBox_link"
37+
rel="external noopener noreferrer"
38+
title="{{ package.humanName }} documentation on symfony.com"
39+
>
40+
<twig:ux:icon name="lucide:book" width="1em" />
41+
Read Docs
42+
</a>
43+
</div>
44+
</div>
45+
{% endfor %}
46+
</div>
47+
</section>
48+
49+
{% endblock %}
50+
51+
{% block aside %}
52+
{{ include('_aside.html.twig') }}
53+
{% endblock %}

0 commit comments

Comments
 (0)