Skip to content

Commit

Permalink
Add instructions on how to link the sitemap (#6448)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
Tc-001 and Dan Jutan committed Mar 7, 2023
1 parent cf8454f commit 28e1224
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/integrations/sitemap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`**
Expand Down

0 comments on commit 28e1224

Please sign in to comment.