Skip to content

Commit 3dd2865

Browse files
authored
Add comment to Sitemap explaining how to customize it (#12164)
1 parent bc247ba commit 3dd2865

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

readthedocs/proxito/tests/test_full.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ def test_default_robots_txt(self, storage_exists):
864864
Sitemap: https://project.readthedocs.io/sitemap.xml
865865
"""
866866
).lstrip()
867-
self.assertEqual(response.content.decode(), expected)
867+
self.assertContains(response, expected)
868868

869869
@mock.patch.object(BuildMediaFileSystemStorageTest, "exists")
870870
def test_default_robots_txt_disallow_hidden_versions(self, storage_exists):
@@ -918,7 +918,7 @@ def test_default_robots_txt_disallow_hidden_versions(self, storage_exists):
918918
Sitemap: https://project.readthedocs.io/sitemap.xml
919919
"""
920920
).lstrip()
921-
self.assertEqual(response.content.decode(), expected)
921+
self.assertContains(response, expected)
922922

923923
@mock.patch.object(BuildMediaFileSystemStorageTest, "exists")
924924
def test_default_robots_txt_private_version(self, storage_exists):

readthedocs/templates/robots.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# This robots.txt file is autogenerated by Read the Docs.
2+
# It controls the crawling and indexing of your documentation by search engines.
3+
#
4+
# You can learn more about robots.txt, including how to customize it, in our documentation:
5+
#
6+
# * Our documentation on Robots.txt: https://docs.readthedocs.com/platform/stable/reference/robots.html
7+
# * Our guide about SEO techniques: https://docs.readthedocs.com/platform/stable/guides/technical-docs-seo-guide.html
8+
19
User-agent: *
210
{% for path in hidden_paths %}
311
Disallow: {{ path }} # Hidden version

readthedocs/templates/sitemap.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
<!--
2+
This sitemap is autogenerated by Read the Docs.
3+
It contains all public versions,
4+
sorted by version number.
5+
6+
You can learn more about sitemaps, including how to customize them, in our documentation:
7+
8+
* Our documentation on Sitemaps: https://docs.readthedocs.com/platform/stable/reference/sitemaps.html
9+
* Our guide about SEO techniques: https://docs.readthedocs.com/platform/stable/guides/technical-docs-seo-guide.html
10+
-->
111
<?xml version="1.0" encoding="UTF-8"?>
212
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
313
xmlns:xhtml="http://www.w3.org/1999/xhtml">

0 commit comments

Comments
 (0)