ddonche/sheriff
0.18.0
1
0
docs reference
[[sitemap]]

Sitemap


Sheriff automatically generates a sitemap.xml file for every portal that has a configured site_url.

A sitemap is an XML document that tells search engines which pages exist on your website. This helps search engines discover and index your content.


Enabling Sitemaps

To enable sitemap generation, add a site_url to the routing section of your portal's config.yall file.

routing:
  site_url: "https://example.com"
routing:
  site_url: "https://example.com"

Without a site_url, Sheriff cannot generate a sitemap because search engines require complete URLs.


Generated Files

When you build your portal, Sheriff automatically generates the following files:

dist/
└── sheriff/
    ├── sitemap.xml
    └── robots.txt
dist/
└── sheriff/
    ├── sitemap.xml
    └── robots.txt

If your portal has a different name, the files will be generated inside that portal's output directory instead.


How It Works

Sheriff generates your sitemap automatically from your portal's routes.json file.

Every page that Sheriff builds is automatically included. There is nothing else you need to configure.


robots.txt

Sheriff also generates a robots.txt file alongside your sitemap.

A typical generated file looks like this:

User-agent: *
Allow: /

Sitemap: https://example.com/sitemap.xml
User-agent: *
Allow: /

Sitemap: https://example.com/sitemap.xml

This tells search engines where to find your sitemap.


Submitting Your Sitemap

Once your site is published, your sitemap will be available at:

https://example.com/sitemap.xml
https://example.com/sitemap.xml

You can submit this URL to search engines such as Google Search Console to help them discover your pages.


Modules Involved

The following module participates in sitemap generation:

  • Trailboss — generates routes.json, sitemap.xml, and robots.txt.