Skip to content

Commit

Permalink
i18n(fr): update server-side-rendering.mdx
Browse files Browse the repository at this point in the history
See #9527
  • Loading branch information
ArmandPhilippot committed Oct 2, 2024
1 parent 3011aee commit 3d9cb1e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/content/docs/fr/guides/server-side-rendering.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -201,16 +201,17 @@ Dans les modes `server` et `hybrid`, une page ou un point de terminaison de l'AP
L'exemple ci-dessous met à jour la valeur d'un cookie pour un compteur de pages vues :
```astro title="src/pages/index.astro" {4,5,9}
```astro title="src/pages/index.astro" {4,5,10}
---
let counter = 0
if (Astro.cookies.has("counter")) {
const cookie = Astro.cookies.get("counter")
counter = cookie.number() + 1
if (Astro.cookies.has('counter')) {
const cookie = Astro.cookies.get('counter')
const value = cookie?.number()
if (value !== undefined && !isNaN(value)) counter = value + 1
}
Astro.cookies.set("counter",counter)
Astro.cookies.set('counter', String(counter))
---
<html>
<h1>Counter = {counter}</h1>
Expand Down

0 comments on commit 3d9cb1e

Please sign in to comment.