Skip to content

Commit c59f497

Browse files
committed
Feature/tips (#128)
* ✨ Feat(tips): init tips section * 💄 UI(tips): improve style * ✨ Feat(tips): improve style, add some tips * 💄 UI(tips): update style to dark mode * Feat(tips): add new audit tip * ✨ Feat(tips): handle tips tags
1 parent 54dfa7c commit c59f497

File tree

17 files changed

+460
-45
lines changed

17 files changed

+460
-45
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
title: easy window resize
3+
author: tmaillard
4+
date: 2024-05-24
5+
expirydate: ""
6+
draft: false
7+
tipstags:
8+
- chrome
9+
---
10+
Un plugin pour retailler rapidement sa fenêtre chrome, toujours utile quand on fait du dév front !
11+
12+
[https://chromewebstore.google.com/detail/easy-window-resize](https://chromewebstore.google.com/detail/easy-window-resize/cfpenpohaapdgnkglcbgjiooipcbcebi?pli=1)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: Faire des commits conventionnels
3+
author: mbollot
4+
date: 2024-05-24
5+
expirydate: ""
6+
draft: false
7+
---
8+
commitizen est un outil en ligne de commande pour faire des commit, quand on le lance il demande si c'est une feature, un bug etc. quelle catégorie est concernée, quel est le message de commit, si cela ferme un ticket… Bref quelques questions et il va créer un joli commit bien formaté, avec un emoji.
9+
10+
<https://github.com/commitizen/cz-cli>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Faire un audit de sécurité
3+
author: mbollot
4+
date: 2024-05-24
5+
expirydate: ""
6+
draft: false
7+
---
8+
Vous êtes piraté ! Ou au moins vous êtes piratable ! Bon, peut-être pas mais comment savoir sans faire un audit ? Alors c'est parti grâce à [lynis](https://github.com/CISOfy/lynis). Lancez \`lynis audit system\` et regardez le résultat. Disponible sur linux, macOS, BSD.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: Mettre à jour toutes les dépendances NPM
3+
author: mbollot
4+
date: 2024-05-23
5+
expirydate: ""
6+
draft: false
7+
tipstags:
8+
- npm
9+
---
10+
Un petit outil rapide pour mettre à jour toutes les dépendances NPM d'un projet :
11+
12+
```
13+
npm install -g yarn-upgrade-all && yarn-upgrade-all
14+
```
15+
Il va supprimer et réinstaller tous les paquets du package.json donc avec des versions à jour :)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: "only-allow : ne vous trompez plus"
3+
author: probillard
4+
date: 2024-05-24
5+
expirydate: ""
6+
draft: false
7+
tipstags:
8+
- npm
9+
- yarn
10+
---
11+
Ça vous arrive de switcher de projet et de vous tromper entre npm et yarn ? Plus maintenant, grâce à [only-allow](https://www.npmjs.com/package/only-allow) !
12+
13+
Ajoutez juste une commade en preinstall (plus d'info sur le readme) et c'est parti
14+
15+
```
16+
{
17+
"scripts": {
18+
"preinstall": "npx only-allow npm"
19+
}
20+
}
21+
```

site/hugo.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,11 @@ images = ["img/logo-code-troopers-tête-couleur.png"]
2828
[markup.goldmark]
2929

3030
[markup.goldmark.renderer]
31-
unsafe = true
31+
unsafe = true
32+
33+
[taxonomies]
34+
category = 'categories'
35+
series = 'series'
36+
tag = 'tags'
37+
tipstag = 'tipstags'
38+

site/layouts/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
{{ partial "cloud" .}}
88
{{ partial "team" .}}
99
{{ partial "blog" .}}
10+
{{ partial "tips" .}}
1011

1112
{{ end }}

site/layouts/partials/tips.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<section id="tips">
2+
<h1>Tips</h1>
3+
4+
<div class="wrapper">
5+
6+
{{ range first 3 (where .Site.RegularPages "Section" "tips") }}
7+
{{ .Render "li" }}
8+
{{ end }}
9+
</div>
10+
<div class="wrapper-center">
11+
<a href="/tips/" class="btn">Tous nos tips</a>
12+
</div>
13+
</section>

site/layouts/tips/li.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{{ $baseurl := .Site.BaseURL }}
2+
3+
<div class="tips-snippet-container">
4+
<div class="tips-snippet">
5+
<h2>
6+
{{ if .Truncated }}
7+
<a aria-label="En savoir plus sur {{ .Title }}" href="{{ .Permalink }}">{{ .Title }}</a>
8+
{{ else }}
9+
{{ .Title }}
10+
{{ end }}
11+
</h2>
12+
<ul class="tags">
13+
{{ range $index, $tag := .Params.tags }}
14+
<li><a aria-label="Tag {{ $tag }}" href="/tipstags/{{ $tag | urlize }}/">{{ $tag }}</a></li>
15+
{{ end }}
16+
</ul>
17+
<div class="content">
18+
{{ .Content }}
19+
</div>
20+
{{ if .Truncated }}
21+
<a aria-label="Voir tous les articles" class="read-more" href="{{ .Permalink }}">En savoir plus
22+
{{ partial "arrow_right.html" . }}
23+
</a>
24+
{{ end }}
25+
</div>
26+
</div>

site/layouts/tips/list.html

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{{ define "main" }}
2+
3+
<section id="tips">
4+
<h1>
5+
Tips
6+
</h1>
7+
8+
<div class="wrapper">
9+
{{ range $index, $page := .Paginator.Pages }}
10+
{{ .Render "li" }}
11+
{{ end }}
12+
</div>
13+
{{ if or (.Paginator.HasPrev) (.Paginator.HasNext) }}
14+
<div class="pagination">
15+
{{ if .Paginator.HasPrev }}
16+
<a href="{{ .Paginator.Prev.URL }}" class="previous-page">
17+
<div class="arrow">{{ partial "arrow_left.html" . }}</div>
18+
Page précédente
19+
</a>
20+
{{ end }}
21+
{{ if .Paginator.HasNext }}
22+
<a href="{{ .Paginator.Next.URL }}" class="next-page">
23+
Page suivante
24+
<div class="arrow">{{ partial "arrow_right.html" . }}</div>
25+
</a>
26+
{{ end }}
27+
</div>
28+
{{ end }}
29+
30+
</section>
31+
{{end}}

0 commit comments

Comments
 (0)