mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
Add instructions on how to link the sitemap (#6448)
* Add instructions on how to link the sitemap * Update packages/integrations/sitemap/README.md Co-authored-by: Dan Jutan <danjutan@gmail.com> --------- Co-authored-by: Dan Jutan <danjutan@gmail.com>
This commit is contained in:
parent
cf8454f796
commit
28e1224d12
1 changed files with 16 additions and 0 deletions
|
@ -82,6 +82,22 @@ Now, [build your site for production](https://docs.astro.build/en/reference/cli-
|
|||
> **Warning**
|
||||
> If you forget to add a `site`, you'll get a friendly warning when you build, and the `sitemap-index.xml` file won't be generated.
|
||||
|
||||
After verifying that the sitemaps are built, you can add them to your site's `<head>` and the `robots.txt` file for crawlers to pick up.
|
||||
|
||||
```html ins={3}
|
||||
// src/layouts/Layout.astro
|
||||
<head>
|
||||
<link rel="sitemap" href="/sitemap-index.xml">
|
||||
</head>
|
||||
```
|
||||
|
||||
```txt ins={4} title="public/robots.txt"
|
||||
User-agent: *
|
||||
Allow: /
|
||||
|
||||
Sitemap: https://<YOUR SITE>/sitemap-index.xml
|
||||
```
|
||||
|
||||
### Example of generated files for a two-page website
|
||||
|
||||
**`sitemap-index.xml`**
|
||||
|
|
Loading…
Reference in a new issue