Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n(fr): update server-side-rendering.mdx #9534

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading