Skip to content

Commit

Permalink
i18n(fr): update server-side-rendering.mdx (#9534)
Browse files Browse the repository at this point in the history
See #9527

Co-authored-by: Yan <61414485+yanthomasdev@users.noreply.github.com>
  • Loading branch information
ArmandPhilippot and yanthomasdev authored Oct 3, 2024
1 parent 8f121b6 commit 6b4889b
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 6b4889b

Please sign in to comment.