0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00

Merge pull request #1739 from JoshBarr/docs/sitemap-clarification

Added section on hostnames to Sitemaps docs
This commit is contained in:
Karl Hobley 2015-09-28 13:25:29 +01:00
commit 7de03ef8c4

View File

@ -36,6 +36,33 @@ Then, in ``urls.py``, you need to add a link to the ``wagtail.contrib.wagtailsit
You should now be able to browse to ``/sitemap.xml`` and see the sitemap working. By default, all published pages in your website will be added to the site map.
Setting the hostname
~~~~~~~~~~~~~~~~~~~~
By default, the sitemap uses the hostname defined in the Wagtail Admin's ``Sites`` area. If your
default site is called ``localhost``, then URLs in the sitemap will look like:
.. code-block:: xml
<url>
<loc>http://localhost/about/</loc>
<lastmod>2015-09-26</lastmod>
</url>
For tools like Google Search Tools to properly index your site, you need to set a valid, crawlable hostname. If you change the site's hostname from ``localhost`` to ``mysite.com``, ``sitemap.xml``
will contain the correct URLs:
.. code-block:: xml
<url>
<loc>http://mysite.com/about/</loc>
<lastmod>2015-09-26</lastmod>
</url>
Find out more about `working with Sites
</reference/pages/model_reference.html?highlight=site#site>`.
Customising
~~~~~~~~~~~