Skip to content

Commit a0c7e50

Browse files
i18n(fr): update integrations-guide/sitemap.mdx
See withastro#12144
1 parent 326a232 commit a0c7e50

File tree

1 file changed

+67
-37
lines changed
  • src/content/docs/fr/guides/integrations-guide

1 file changed

+67
-37
lines changed

src/content/docs/fr/guides/integrations-guide/sitemap.mdx

Lines changed: 67 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ category: other
99
i18nReady: true
1010
---
1111
import PackageManagerTabs from '~/components/tabs/PackageManagerTabs.astro';
12+
import Since from '~/components/Since.astro';
1213

1314
Cette **[intégration Astro][astro-integration]** génère un sitemap basé sur vos pages lorsque vous compilez votre projet Astro.
1415

@@ -93,7 +94,7 @@ import { defineConfig } from 'astro/config';
9394
import sitemap from '@astrojs/sitemap';
9495

9596
export default defineConfig({
96-
site: 'https://stargazers.club',
97+
site: 'https://example.com',
9798
integrations: [sitemap()],
9899
// ...
99100
});
@@ -112,7 +113,7 @@ Pour les sites de très grande taille, il peut y avoir des fichiers numérotés
112113
<?xml version="1.0" encoding="UTF-8"?>
113114
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
114115
<sitemap>
115-
<loc>https://stargazers.club/sitemap-0.xml</loc>
116+
<loc>https://example.com/sitemap-0.xml</loc>
116117
</sitemap>
117118
</sitemapindex>
118119
```
@@ -121,10 +122,10 @@ Pour les sites de très grande taille, il peut y avoir des fichiers numérotés
121122
<?xml version="1.0" encoding="UTF-8"?>
122123
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
123124
<url>
124-
<loc>https://stargazers.club/</loc>
125+
<loc>https://example.com/</loc>
125126
</url>
126127
<url>
127-
<loc>https://stargazers.club/second-page/</loc>
128+
<loc>https://example.com/deuxieme-page/</loc>
128129
</url>
129130
</urlset>
130131
```
@@ -201,10 +202,10 @@ import { defineConfig } from 'astro/config';
201202
import sitemap from '@astrojs/sitemap';
202203

203204
export default defineConfig({
204-
site: 'https://stargazers.club',
205+
site: 'https://example.com',
205206
integrations: [
206207
sitemap({
207-
filter: (page) => page !== 'https://stargazers.club/salon-prive-secret/',
208+
filter: (page) => page !== 'https://example.com/salon-prive-secret/',
208209
}),
209210
],
210211
});
@@ -219,32 +220,61 @@ import { defineConfig } from 'astro/config';
219220
import sitemap from '@astrojs/sitemap';
220221

221222
export default defineConfig({
222-
site: 'https://stargazers.club',
223+
site: 'https://example.com',
223224
integrations: [
224225
sitemap({
225226
filter: (page) =>
226-
page !== 'https://stargazers.club/salon-prive-secret-1/' &&
227-
page !== 'https://stargazers.club/salon-prive-secret-2/' &&
228-
page !== 'https://stargazers.club/salon-prive-secret-3/' &&
229-
page !== 'https://stargazers.club/salon-prive-secret-4/',
227+
page !== 'https://example.com/salon-prive-secret-1/' &&
228+
page !== 'https://example.com/salon-prive-secret-2/' &&
229+
page !== 'https://example.com/salon-prive-secret-3/' &&
230+
page !== 'https://example.com/salon-prive-secret-4/',
230231
}),
231232
],
232233
});
233234
```
234235

235236
### customPages
236237

237-
Dans certains cas, une page peut faire partie de votre site déployé, mais pas de votre projet Astro. Si vous souhaitez inclure dans votre sitemap une page qui n'a pas été créée par Astro, vous pouvez utiliser cette option.
238+
Un tableau de pages générées en externe à inclure dans le fichier sitemap généré.
239+
240+
Utilisez cette option pour inclure dans votre sitemap des pages qui font partie de votre site déployé mais qui ne sont pas créées par Astro.
241+
242+
```js title="astro.config.mjs" ins={8}
243+
import { defineConfig } from 'astro/config';
244+
import sitemap from '@astrojs/sitemap';
245+
246+
export default defineConfig({
247+
site: 'https://example.com',
248+
integrations: [
249+
sitemap({
250+
customPages: ['https://example.com/page-externe1', 'https://example.com/page-externe2'],
251+
}),
252+
],
253+
});
254+
```
255+
256+
### customSitemaps
257+
258+
<p>
259+
260+
**Type :** `string[]`<br />
261+
**Par défaut :** `[]`<br />
262+
<Since v="3.5.0" pkg="@astrojs/sitemap" />
263+
</p>
264+
265+
Un tableau de sitemaps générés en externe à inclure dans le fichier `sitemap-index.xml` au côté des entrées de sitemap générées.
266+
267+
Utilisez cette option pour inclure des sitemaps externes dans le fichier `sitemap-index.xml` créé par Astro pour les sections de votre site déployé qui possèdent leurs propres sitemaps non créés par Astro. Cette option est utile lorsque vous hébergez plusieurs services sous le même domaine.
238268

239269
```js title="astro.config.mjs" ins={8}
240270
import { defineConfig } from 'astro/config';
241271
import sitemap from '@astrojs/sitemap';
242272

243273
export default defineConfig({
244-
site: 'https://stargazers.club',
274+
site: 'https://example.com',
245275
integrations: [
246276
sitemap({
247-
customPages: ['https://stargazers.club/page-externe', 'https://stargazers.club/page-externe2'],
277+
customSitemaps: ['https://example.com/blog/sitemap.xml', 'https://example.com/boutique/sitemap.xml'],
248278
}),
249279
],
250280
});
@@ -259,7 +289,7 @@ import { defineConfig } from 'astro/config';
259289
import sitemap from '@astrojs/sitemap';
260290

261291
export default defineConfig({
262-
site: 'https://stargazers.club',
292+
site: 'https://example.com',
263293
integrations: [
264294
sitemap({
265295
entryLimit: 10000,
@@ -283,7 +313,7 @@ import { defineConfig } from 'astro/config';
283313
import sitemap from '@astrojs/sitemap';
284314

285315
export default defineConfig({
286-
site: 'https://stargazers.club',
316+
site: 'https://example.com',
287317
integrations: [
288318
sitemap({
289319
changefreq: 'weekly',
@@ -319,7 +349,7 @@ import { defineConfig } from 'astro/config';
319349
import sitemap from '@astrojs/sitemap';
320350

321351
export default defineConfig({
322-
site: 'https://stargazers.club',
352+
site: 'https://example.com',
323353
integrations: [
324354
sitemap({
325355
serialize(item) {
@@ -356,11 +386,11 @@ import { defineConfig } from 'astro/config';
356386
import sitemap from '@astrojs/sitemap';
357387

358388
export default defineConfig({
359-
site: 'https://stargazers.club',
389+
site: 'https://example.com',
360390
integrations: [
361391
sitemap({
362392
i18n: {
363-
defaultLocale: 'en', // Toutes les URL qui ne contiennent pas `es` ou `fr` après `https://stargazers.club/` seront traitées comme le paramètre régional par défaut, c'est-à-dire `en`
393+
defaultLocale: 'en', // Toutes les URL qui ne contiennent pas `es` ou `fr` après `https://example.com/` seront traitées comme le paramètre régional par défaut, c'est-à-dire `en`
364394
locales: {
365395
en: 'en-US', // La valeur `defaultLocale` doit être présente dans les clés `locales`.
366396
es: 'es-ES',
@@ -377,28 +407,28 @@ Le plan du site qui en résulte ressemble à ceci :
377407
```xml title="sitemap-0.xml"
378408
...
379409
<url>
380-
<loc>https://stargazers.club/</loc>
381-
<xhtml:link rel="alternate" hreflang="en-US" href="https://stargazers.club/"/>
382-
<xhtml:link rel="alternate" hreflang="es-ES" href="https://stargazers.club/es/"/>
383-
<xhtml:link rel="alternate" hreflang="fr-CA" href="https://stargazers.club/fr/"/>
410+
<loc>https://example.com/</loc>
411+
<xhtml:link rel="alternate" hreflang="en-US" href="https://example.com/"/>
412+
<xhtml:link rel="alternate" hreflang="es-ES" href="https://example.com/es/"/>
413+
<xhtml:link rel="alternate" hreflang="fr-CA" href="https://example.com/fr/"/>
384414
</url>
385415
<url>
386-
<loc>https://stargazers.club/es/</loc>
387-
<xhtml:link rel="alternate" hreflang="en-US" href="https://stargazers.club/"/>
388-
<xhtml:link rel="alternate" hreflang="es-ES" href="https://stargazers.club/es/"/>
389-
<xhtml:link rel="alternate" hreflang="fr-CA" href="https://stargazers.club/fr/"/>
416+
<loc>https://example.com/es/</loc>
417+
<xhtml:link rel="alternate" hreflang="en-US" href="https://example.com/"/>
418+
<xhtml:link rel="alternate" hreflang="es-ES" href="https://example.com/es/"/>
419+
<xhtml:link rel="alternate" hreflang="fr-CA" href="https://example.com/fr/"/>
390420
</url>
391421
<url>
392-
<loc>https://stargazers.club/fr/</loc>
393-
<xhtml:link rel="alternate" hreflang="en-US" href="https://stargazers.club/"/>
394-
<xhtml:link rel="alternate" hreflang="es-ES" href="https://stargazers.club/es/"/>
395-
<xhtml:link rel="alternate" hreflang="fr-CA" href="https://stargazers.club/fr/"/>
422+
<loc>https://example.com/fr/</loc>
423+
<xhtml:link rel="alternate" hreflang="en-US" href="https://example.com/"/>
424+
<xhtml:link rel="alternate" hreflang="es-ES" href="https://example.com/es/"/>
425+
<xhtml:link rel="alternate" hreflang="fr-CA" href="https://example.com/fr/"/>
396426
</url>
397427
<url>
398-
<loc>https://stargazers.club/es/second-page/</loc>
399-
<xhtml:link rel="alternate" hreflang="es-ES" href="https://stargazers.club/es/second-page/"/>
400-
<xhtml:link rel="alternate" hreflang="fr-CA" href="https://stargazers.club/fr/second-page/"/>
401-
<xhtml:link rel="alternate" hreflang="en-US" href="https://stargazers.club/second-page/"/>
428+
<loc>https://example.com/es/deuxieme-page/</loc>
429+
<xhtml:link rel="alternate" hreflang="es-ES" href="https://example.com/es/deuxieme-page/"/>
430+
<xhtml:link rel="alternate" hreflang="fr-CA" href="https://example.com/fr/deuxieme-page/"/>
431+
<xhtml:link rel="alternate" hreflang="en-US" href="https://example.com/deuxieme-page/"/>
402432
</url>
403433
...
404434
```
@@ -434,7 +464,7 @@ import { defineConfig } from 'astro/config';
434464
import sitemap from '@astrojs/sitemap';
435465

436466
export default defineConfig({
437-
site: 'https://stargazers.club',
467+
site: 'https://example.com',
438468
integrations: [
439469
sitemap({
440470
filenameBase: 'sitemap-astronomie'
@@ -443,7 +473,7 @@ export default defineConfig({
443473
});
444474
```
445475

446-
La configuration donnée générera des fichiers de sitemap aux adresses `https://stargazers.club/astronomy-sitemap-0.xml` et `https://stargazers.club/astronomy-sitemap-index.xml`.
476+
La configuration donnée générera des fichiers de sitemap aux adresses `https://example.com/sitemap-astronomie-0.xml` et `https://example.com/sitemap-astronomie-index.xml`.
447477

448478
## Exemples
449479

0 commit comments

Comments
 (0)