-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
451 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ | |
} | ||
|
||
p { | ||
margin: 0 0 15px; | ||
max-width: 700px; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
@use '../abstracts' as *; | ||
|
||
.glossary-list { | ||
margin: 0; | ||
padding: 0; | ||
width: 33.33%; | ||
min-width: 33.33%; | ||
} | ||
|
||
.glossary-list__item { | ||
margin-bottom: 15px; | ||
padding-right: 30px; | ||
padding-left: 100px; | ||
display: flex; | ||
|
||
&:before, | ||
&:after { | ||
display: none; | ||
} | ||
|
||
&:first-of-type { | ||
margin-top: 0 !important; | ||
} | ||
|
||
a { | ||
font-size: 20px; | ||
line-height: 1.3; | ||
} | ||
} | ||
|
||
[class*="glossary-list__item--"] { | ||
margin-top: 50px !important; | ||
position: relative; | ||
|
||
&:before { | ||
height: unset; | ||
width: unset; | ||
position: absolute; | ||
top: -8px; | ||
left: 0; | ||
display: flex; | ||
font-family: 'DM Serif Display'; | ||
font-size: 72px; | ||
line-height: 1; | ||
text-transform: uppercase; | ||
border: none; | ||
background: none; | ||
} | ||
} | ||
|
||
$characters: ( | ||
0: '#', | ||
a: 'a', | ||
b: 'b', | ||
c: 'c', | ||
d: 'd', | ||
e: 'e', | ||
f: 'f', | ||
g: 'g', | ||
h: 'h', | ||
i: 'i', | ||
j: 'j', | ||
k: 'k', | ||
l: 'l', | ||
m: 'm', | ||
n: 'n', | ||
o: 'o', | ||
p: 'p', | ||
q: 'q', | ||
r: 'r', | ||
s: 's', | ||
t: 't', | ||
u: 'u', | ||
v: 'v', | ||
w: 'w', | ||
x: 'x', | ||
y: 'y', | ||
z: 'z' | ||
); | ||
|
||
@each $character, $character-icon in $characters { | ||
.glossary-list__item--#{$character} { | ||
&:before { | ||
content: $character-icon; | ||
} | ||
} | ||
} | ||
|
||
@media(max-width: $screen-md) { | ||
.glossary-list__item { | ||
padding-left: 60px; | ||
|
||
a { | ||
font-size: 18px; | ||
} | ||
} | ||
|
||
[class*="glossary-list__item--"] { | ||
&:before { | ||
top: -1px; | ||
font-size: 40px; | ||
} | ||
} | ||
} | ||
|
||
@media(max-width: $screen-xs) { | ||
.glossary-list { | ||
width: 100%; | ||
min-width: 100%; | ||
} | ||
|
||
[class*="glossary-list__item--"] { | ||
&:first-of-type { | ||
margin-top: 50px !important; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@use '../abstracts' as *; | ||
|
||
.glossary { | ||
margin: 0 0 100px; | ||
display: flex; | ||
flex-wrap: wrap; | ||
} | ||
|
||
@media (max-width: $screen-xs) { | ||
.glossary { | ||
margin: 0 0 50px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@use '../abstracts' as *; | ||
|
||
.page-glossary { | ||
.banner { | ||
height: 1550px; | ||
} | ||
|
||
main { | ||
background-image: none; // remove background-image to prevent ugliness when not much content on page | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
name: "AWS" | ||
logo: "build/images/services/aws.svg" | ||
externalLink: https://aws.amazon.com/fr/ | ||
#metaDescription: TODO | ||
--- | ||
|
||
Some **markdown** content |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
name: "Exemple" | ||
logo: "build/images/technos/exemple.svg" | ||
externalLink: http://example.org | ||
|
||
# False to prevent listing it on the glossary page. | ||
# Cans till be externalLinked from articles or case studies. | ||
listInGlossary: false | ||
|
||
# Array of slugs of related articles to show on the glossary term page. | ||
# If not provided (null), will search for related articles by their tags. | ||
articles: [] | ||
|
||
metaDescription: Une description courte à utiliser dans les meta de la page | ||
--- | ||
|
||
Some **markdown** content |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
name: "OVH Cloud" | ||
logo: "build/images/services/ovh-cloud.svg" | ||
externalLink: https://www.ovhcloud.com/fr/ | ||
#metaDescription: TODO | ||
--- | ||
|
||
Some **markdown** content |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
name: "Scaleway" | ||
logo: "build/images/services/scaleway.svg" | ||
externalLink: https://www.scaleway.com/fr/ | ||
#metaDescription: TODO | ||
--- | ||
|
||
Some **markdown** content |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Controller; | ||
|
||
use App\Glossary\GlossaryBuilder; | ||
use App\Model\Article; | ||
use App\Model\CaseStudy; | ||
use App\Model\Glossary\Term; | ||
use Stenope\Bundle\ContentManagerInterface; | ||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; | ||
use Symfony\Component\HttpFoundation\Response; | ||
use Symfony\Component\Routing\Annotation\Route; | ||
|
||
#[Route('/glossaire')] | ||
class GlossaryController extends AbstractController | ||
{ | ||
private ContentManagerInterface $manager; | ||
|
||
public function __construct(ContentManagerInterface $manager) | ||
{ | ||
$this->manager = $manager; | ||
} | ||
|
||
#[Route('/', name: 'glossary')] | ||
public function glossary(GlossaryBuilder $builder): Response | ||
{ | ||
$terms = $this->manager->getContents(Term::class, 'name', ['listInGlossary' => true]); | ||
$articles = $this->manager->getContents(Article::class, ['date' => false]); | ||
|
||
return $this->render('glossary/index.html.twig', [ | ||
'glossary' => $builder->build($terms), | ||
'articles' => \array_slice($articles, 0, 2), | ||
]); | ||
} | ||
|
||
#[Route('/{term}', name: 'glossary_term')] | ||
public function show(Term $term): Response | ||
{ | ||
$articlesFilter = null !== $term->articles | ||
// Search for articles by their slug if provided | ||
? static fn ($article) => \in_array($article->slug, $term->articles, true) | ||
// otherwise by their tags matching the term slug | ||
: static fn (Article $article): bool => $article->hasTag($term->slug) | ||
; | ||
|
||
$articles = $this->manager->getContents(Article::class, ['date' => false], $articlesFilter); | ||
|
||
$caseStudies = $this->manager->getContents( | ||
CaseStudy::class, | ||
['date' => false], | ||
fn (CaseStudy $caseStudy): bool => $caseStudy->enabled && $caseStudy->hasTerm($term) | ||
); | ||
|
||
return $this->render('glossary/term.html.twig', [ | ||
'term' => $term, | ||
'articles' => \array_slice($articles, 0, 3), | ||
'caseStudies' => $caseStudies, | ||
])->setLastModified($term->lastModified); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.