@@ -8,8 +8,8 @@ githubIntegrationURL: 'https://github.com/withastro/astro/tree/main/packages/int
8
8
category : other
9
9
i18nReady : true
10
10
---
11
-
12
11
import PackageManagerTabs from ' ~/components/tabs/PackageManagerTabs.astro' ;
12
+ import Since from ' ~/components/Since.astro' ;
13
13
14
14
이 ** [ Astro 통합] [ astro-integration ] 은** Astro 프로젝트를 빌드할 때 페이지를 기반으로 사이트맵을 생성합니다.
15
15
@@ -94,7 +94,7 @@ import { defineConfig } from 'astro/config';
94
94
import sitemap from ' @astrojs/sitemap' ;
95
95
96
96
export default defineConfig ({
97
- site: ' https://stargazers.club ' ,
97
+ site: ' https://example.com ' ,
98
98
integrations: [sitemap ()],
99
99
// ...
100
100
});
@@ -113,7 +113,7 @@ export default defineConfig({
113
113
<?xml version =" 1.0" encoding =" UTF-8" ?>
114
114
<sitemapindex xmlns =" http://www.sitemaps.org/schemas/sitemap/0.9" >
115
115
<sitemap >
116
- <loc >https://stargazers.club /sitemap-0.xml</loc >
116
+ <loc >https://example.com /sitemap-0.xml</loc >
117
117
</sitemap >
118
118
</sitemapindex >
119
119
```
@@ -122,10 +122,10 @@ export default defineConfig({
122
122
<?xml version =" 1.0" encoding =" UTF-8" ?>
123
123
<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" >
124
124
<url >
125
- <loc >https://stargazers.club /</loc >
125
+ <loc >https://example.com /</loc >
126
126
</url >
127
127
<url >
128
- <loc >https://stargazers.club /second-page/</loc >
128
+ <loc >https://example.com /second-page/</loc >
129
129
</url >
130
130
</urlset >
131
131
```
@@ -202,10 +202,10 @@ import { defineConfig } from 'astro/config';
202
202
import sitemap from ' @astrojs/sitemap' ;
203
203
204
204
export default defineConfig ({
205
- site: ' https://stargazers.club ' ,
205
+ site: ' https://example.com ' ,
206
206
integrations: [
207
207
sitemap ({
208
- filter : (page ) => page !== ' https://stargazers.club /secret-vip-lounge/' ,
208
+ filter : (page ) => page !== ' https://example.com /secret-vip-lounge/' ,
209
209
}),
210
210
],
211
211
});
@@ -220,32 +220,61 @@ import { defineConfig } from 'astro/config';
220
220
import sitemap from ' @astrojs/sitemap' ;
221
221
222
222
export default defineConfig ({
223
- site: ' https://stargazers.club ' ,
223
+ site: ' https://example.com ' ,
224
224
integrations: [
225
225
sitemap ({
226
226
filter : (page ) =>
227
- page !== ' https://stargazers.club /secret-vip-lounge-1/' &&
228
- page !== ' https://stargazers.club /secret-vip-lounge-2/' &&
229
- page !== ' https://stargazers.club /secret-vip-lounge-3/' &&
230
- page !== ' https://stargazers.club /secret-vip-lounge-4/' ,
227
+ page !== ' https://example.com /secret-vip-lounge-1/' &&
228
+ page !== ' https://example.com /secret-vip-lounge-2/' &&
229
+ page !== ' https://example.com /secret-vip-lounge-3/' &&
230
+ page !== ' https://example.com /secret-vip-lounge-4/' ,
231
231
}),
232
232
],
233
233
});
234
234
```
235
235
236
236
### customPages
237
237
238
- 어떤 경우에는 페이지가 배포된 사이트의 일부이지만 Astro 프로젝트의 일부가 아닐 수도 있습니다. Astro에서 생성하지 * 않은* 페이지를 사이트맵에 포함하고 싶다면 이 옵션을 사용할 수 있습니다.
238
+ 외부에서 생성된 페이지의 배열입니다. 이는 생성된 사이트맵 파일에 포함됩니다.
239
+
240
+ 이 옵션을 사용하면 배포된 사이트의 일부이지만 Astro에서 생성하지 않은 페이지를 사이트맵에 포함할 수 있습니다.
239
241
240
242
``` js title="astro.config.mjs" ins={8}
241
243
import { defineConfig } from ' astro/config' ;
242
244
import sitemap from ' @astrojs/sitemap' ;
243
245
244
246
export default defineConfig ({
245
- site: ' https://stargazers.club ' ,
247
+ site: ' https://example.com ' ,
246
248
integrations: [
247
249
sitemap ({
248
- customPages: [' https://stargazers.club/external-page' , ' https://stargazers.club/external-page2' ],
250
+ customPages: [' https://example.com/external-page1' , ' https://example.com/external-page2' ],
251
+ }),
252
+ ],
253
+ });
254
+ ```
255
+
256
+ ### customSitemaps
257
+
258
+ <p >
259
+
260
+ ** 타입:** ` string[] ` <br />
261
+ ** 기본값:** ` [] ` <br />
262
+ <Since v = " 3.5.0" pkg = " @astrojs/sitemap" />
263
+ </p >
264
+
265
+ 외부에서 생성된 사이트맵의 배열로, 생성된 사이트맵 항목과 함께 ` sitemap-index.xml ` 파일에 포함할 수 있습니다.
266
+
267
+ 이 옵션을 사용하면 배포된 사이트의 섹션에 Astro에서 생성하지 않은 자체 사이트맵이 있는 경우 Astro에서 생성한 ` sitemap-index.xml ` 파일에 외부 사이트맵을 포함할 수 있습니다. 이 옵션은 동일한 도메인에서 여러 서비스를 호스팅할 때 유용합니다.
268
+
269
+ ``` js title="astro.config.mjs" ins={8}
270
+ import { defineConfig } from ' astro/config' ;
271
+ import sitemap from ' @astrojs/sitemap' ;
272
+
273
+ export default defineConfig ({
274
+ site: ' https://example.com' ,
275
+ integrations: [
276
+ sitemap ({
277
+ customSitemaps: [' https://example.com/blog/sitemap.xml' , ' https://example.com/shop/sitemap.xml' ],
249
278
}),
250
279
],
251
280
});
@@ -260,7 +289,7 @@ import { defineConfig } from 'astro/config';
260
289
import sitemap from ' @astrojs/sitemap' ;
261
290
262
291
export default defineConfig ({
263
- site: ' https://stargazers.club ' ,
292
+ site: ' https://example.com ' ,
264
293
integrations: [
265
294
sitemap ({
266
295
entryLimit: 10000 ,
@@ -284,7 +313,7 @@ import { defineConfig } from 'astro/config';
284
313
import sitemap from ' @astrojs/sitemap' ;
285
314
286
315
export default defineConfig ({
287
- site: ' https://stargazers.club ' ,
316
+ site: ' https://example.com ' ,
288
317
integrations: [
289
318
sitemap ({
290
319
changefreq: ' weekly' ,
@@ -320,7 +349,7 @@ import { defineConfig } from 'astro/config';
320
349
import sitemap from ' @astrojs/sitemap' ;
321
350
322
351
export default defineConfig ({
323
- site: ' https://stargazers.club ' ,
352
+ site: ' https://example.com ' ,
324
353
integrations: [
325
354
sitemap ({
326
355
serialize (item ) {
@@ -357,11 +386,11 @@ import { defineConfig } from 'astro/config';
357
386
import sitemap from ' @astrojs/sitemap' ;
358
387
359
388
export default defineConfig ({
360
- site: ' https://stargazers.club ' ,
389
+ site: ' https://example.com ' ,
361
390
integrations: [
362
391
sitemap ({
363
392
i18n: {
364
- defaultLocale: ' en' , // `https://stargazers.club /` 뒤에 `es` 또는 `fr`이 포함되지 않은 모든 URL은 기본 로케일, 즉 `en`으로 처리됩니다.
393
+ defaultLocale: ' en' , // `https://example.com /` 뒤에 `es` 또는 `fr`이 포함되지 않은 모든 URL은 기본 로케일, 즉 `en`으로 처리됩니다.
365
394
locales: {
366
395
en: ' en-US' , // `defaultLocale` 값은 `locales` 키에 있어야 합니다.
367
396
es: ' es-ES' ,
@@ -378,28 +407,28 @@ export default defineConfig({
378
407
``` xml title="sitemap-0.xml"
379
408
...
380
409
<url >
381
- <loc >https://stargazers.club /</loc >
382
- <xhtml : link rel =" alternate" hreflang =" en-US" href =" https://stargazers.club /" />
383
- <xhtml : link rel =" alternate" hreflang =" es-ES" href =" https://stargazers.club /es/" />
384
- <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/" />
385
414
</url >
386
415
<url >
387
- <loc >https://stargazers.club /es/</loc >
388
- <xhtml : link rel =" alternate" hreflang =" en-US" href =" https://stargazers.club /" />
389
- <xhtml : link rel =" alternate" hreflang =" es-ES" href =" https://stargazers.club /es/" />
390
- <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/" />
391
420
</url >
392
421
<url >
393
- <loc >https://stargazers.club /fr/</loc >
394
- <xhtml : link rel =" alternate" hreflang =" en-US" href =" https://stargazers.club /" />
395
- <xhtml : link rel =" alternate" hreflang =" es-ES" href =" https://stargazers.club /es/" />
396
- <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/" />
397
426
</url >
398
427
<url >
399
- <loc >https://stargazers.club /es/second-page/</loc >
400
- <xhtml : link rel =" alternate" hreflang =" es-ES" href =" https://stargazers.club /es/second-page/" />
401
- <xhtml : link rel =" alternate" hreflang =" fr-CA" href =" https://stargazers.club /fr/second-page/" />
402
- <xhtml : link rel =" alternate" hreflang =" en-US" href =" https://stargazers.club /second-page/" />
428
+ <loc >https://example.com /es/second-page/</loc >
429
+ <xhtml : link rel =" alternate" hreflang =" es-ES" href =" https://example.com /es/second-page/" />
430
+ <xhtml : link rel =" alternate" hreflang =" fr-CA" href =" https://example.com /fr/second-page/" />
431
+ <xhtml : link rel =" alternate" hreflang =" en-US" href =" https://example.com /second-page/" />
403
432
</url >
404
433
...
405
434
```
@@ -435,7 +464,7 @@ import { defineConfig } from 'astro/config';
435
464
import sitemap from ' @astrojs/sitemap' ;
436
465
437
466
export default defineConfig ({
438
- site: ' https://stargazers.club ' ,
467
+ site: ' https://example.com ' ,
439
468
integrations: [
440
469
sitemap ({
441
470
filenameBase: ' astronomy-sitemap'
@@ -444,7 +473,7 @@ export default defineConfig({
444
473
});
445
474
```
446
475
447
- 위 구성은 ` https://stargazers.club /astronomy-sitemap-0.xml ` 및 ` https://stargazers.club /astronomy-sitemap-index.xml ` 에 사이트맵 파일을 생성합니다.
476
+ 위 구성은 ` https://example.com /astronomy-sitemap-0.xml ` 및 ` https://example.com /astronomy-sitemap-index.xml ` 에 사이트맵 파일을 생성합니다.
448
477
449
478
## 예시
450
479
0 commit comments