Skip to content

Commit 4beee77

Browse files
committed
Merge branch 'master' into index-more-domain-data
2 parents 9c9f03f + aaa3ade commit 4beee77

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1232
-215
lines changed
Loading

docs/advertising/ad-blocking.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Going ad-free
5353
-------------
5454

5555
Users can go completely ad-free
56-
by becoming a `Gold Member <https://readthedocs.org/accounts/gold/>`_
56+
by becoming a `Gold member <https://readthedocs.org/accounts/gold/>`_
5757
or a `Supporter <https://readthedocs.org/sustainability/#donations>`_.
5858
Thank you for supporting Read the Docs.
5959

docs/advertising/ethical-advertising.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,9 @@ Opting Out
156156
We have added multiple ways to opt out of the advertising on Read the Docs.
157157

158158
1. You can go completely ad-free
159-
by becoming a `Gold Member <https://readthedocs.org/accounts/gold/>`_
159+
by becoming a `Gold member <https://readthedocs.org/accounts/gold/>`_
160160
or a `Supporter <https://readthedocs.org/sustainability/#donations>`_.
161+
Additionally, Gold members may remove advertising from their projects for all visitors.
161162

162163
2. You can opt out of seeing paid advertisements on documentation pages:
163164

@@ -182,5 +183,4 @@ We have added multiple ways to opt out of the advertising on Read the Docs.
182183
but our commercial plans don't seem like the right fit,
183184
please `get in touch`_ to discuss alternatives to advertising.
184185

185-
.. _paid plans: https://readthedocs.com/pricing/
186186
.. _get in touch: mailto:[email protected]?subject=Alternatives%20to%20advertising

docs/advertising/index.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ that respects user privacy.
2222

2323
We recognize that advertising is not for everyone.
2424
You may :ref:`opt out of paid advertising <advertising/ethical-advertising:Opting Out>`
25-
-- you will still see :ref:`community ads <advertising/ethical-advertising:Community Ads>` --
26-
or you can go ad-free by `becoming a Gold Member`_ or a `Supporter`_ of Read the Docs.
25+
although you will still see :ref:`community ads <advertising/ethical-advertising:Community Ads>`.
26+
You can go ad-free by `becoming a Gold member`_ or a `Supporter`_ of Read the Docs.
27+
Gold members can also remove advertising from their projects for all visitors.
2728

2829
For businesses looking to remove advertising,
2930
please consider :doc:`Read the Docs for Business </commercial/index>`.
3031

31-
.. _becoming a Gold Member: https://readthedocs.org/accounts/gold/
32+
.. _becoming a Gold member: https://readthedocs.org/accounts/gold/
3233
.. _Supporter: https://readthedocs.org/sustainability/#donations
3334

3435
.. toctree::

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def get_version():
5656
intersphinx_mapping = {
5757
'python': ('https://python.readthedocs.io/en/latest/', None),
5858
'django': ('https://django.readthedocs.io/en/1.11.x/', None),
59-
'sphinx': ('https://sphinx.readthedocs.io/en/latest/', None),
59+
'sphinx': ('https://www.sphinx-doc.org/en/master/', None),
6060
}
6161
htmlhelp_basename = 'ReadTheDocsdoc'
6262
latex_documents = [

docs/guides/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ These guides will help you customize or tune aspects of the Read the Docs build
3434

3535
build-notifications
3636
build-using-too-many-resources
37+
technical-docs-seo-guide
3738
canonical
3839
conda
3940
environment-variables
Lines changed: 286 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,286 @@
1+
Technical Documentation Search Engine Optimization (SEO) Guide
2+
==============================================================
3+
4+
.. meta::
5+
:description lang=en:
6+
Looking to optimize your Sphinx documentation for search engines?
7+
This SEO guide will help your docs be better understood by both people and crawlers
8+
as well as help you rank higher in search engine results.
9+
10+
11+
This guide will help you optimize your documentation for search engines
12+
with the goal of increasing traffic to your docs.
13+
While you optimize your docs to make them more crawler friendly for search engine spiders,
14+
it's important to keep in mind that your ultimate goal is to make your docs
15+
more discoverable for your users.
16+
**You're trying to make sure that when a user types a question into a search engine
17+
that is answerable by your documentation, that your docs appear in the results.**
18+
19+
This guide isn't meant to be your only resource on SEO,
20+
and there's a lot of SEO topics not covered here.
21+
For additional reading, please see the
22+
:ref:`external resources <guides/technical-docs-seo-guide:External resources>` section.
23+
24+
While many of the topics here apply to all forms of technical documentation,
25+
this guide will focus on Sphinx, which is the most common
26+
documentation authoring tool on Read the Docs,
27+
as well as improvements provided by Read the Docs itself.
28+
29+
30+
.. contents:: Table of contents
31+
:local:
32+
:backlinks: none
33+
:depth: 3
34+
35+
36+
SEO Basics
37+
----------
38+
39+
Search engines like Google and Bing crawl through the internet
40+
following links in an attempt to understand and build an index
41+
of what various pages and sites are about.
42+
This is called "crawling" or "indexing".
43+
When a person sends a query to a search engine,
44+
the search engine evaluates this index using a number of factors
45+
and attempts to return the results most likely to answer that person's question.
46+
47+
How search engines "rank" sites based on a person's query
48+
is part of their secret sauce.
49+
While some search engines publish the basics of their algorithms
50+
(see Google's published details on PageRank), few search engines
51+
give all of the details in an attempt to prevent users from gaming the rankings
52+
with low value content which happens to rank well.
53+
54+
Both `Google <https://support.google.com/webmasters/answer/35769>`_
55+
and `Bing <https://www.bing.com/webmaster/help/webmaster-guidelines-30fba23a>`_ publish a set of guidelines
56+
to help make sites easier to understand for search engines and rank better.
57+
To summarize some of the most important aspects
58+
as they apply to technical documentation, your site should:
59+
60+
* Use descriptive and accurate titles in the HTML ``<title>`` tag.
61+
* Ensure your URLs are descriptive. They are displayed in search results.
62+
* Avoid low content pages or pages with very little original content.
63+
* Avoid tactics that attempt to increase your search engine ranking
64+
without actually improving content.
65+
* Google specifically `warns about automatically generated content`_
66+
although this applies primarily to keyword stuffing and low value content.
67+
High quality documentation generated from source code
68+
(eg. auto generated API documentation) seems OK.
69+
70+
.. _warns about automatically generated content: https://support.google.com/webmasters/answer/2721306
71+
72+
While both Google and Bing discuss site performance as an important factor
73+
in search result ranking, this guide is not going to discuss it in detail.
74+
Most technical documentation that uses Sphinx or Read the Docs
75+
generates static HTML and the performance is typically decent
76+
relative to most of the internet.
77+
78+
79+
Optimizing your docs for search engine spiders
80+
----------------------------------------------
81+
82+
Once a crawler or spider finds your site, it will follow links and redirects
83+
in an attempt to find any and all pages on your site.
84+
While there are a few ways to guide the search engine in its crawl
85+
for example by using a :ref:`sitemap <guides/technical-docs-seo-guide:Use a sitemap.xml file>`
86+
or a :ref:`robots.txt file <guides/technical-docs-seo-guide:Use a robots.txt file>`
87+
which we'll discuss shortly,
88+
the most important thing is making sure the spider can follow links on your site
89+
and get to all your pages.
90+
91+
Avoid orphan pages
92+
~~~~~~~~~~~~~~~~~~
93+
94+
Sphinx calls pages that don't have links to them "orphans"
95+
and will throw a warning while building documentation that contains an orphan
96+
unless the warning is silenced with the :ref:`orphan directive <sphinx:metadata>`:
97+
98+
::
99+
100+
$ make html
101+
sphinx-build -b html -d _build/doctrees . _build/html
102+
Running Sphinx v1.8.5
103+
...
104+
checking consistency... /path/to/file.rst: WARNING: document isn't included in any toctree
105+
done
106+
...
107+
build finished with problems, 1 warning.
108+
109+
You can make all Sphinx warnings into errors during your build process
110+
by setting ``SPHINXOPTS = -W --keep-going`` in your Sphinx Makefile.
111+
112+
113+
Avoid uncrawlable content
114+
~~~~~~~~~~~~~~~~~~~~~~~~~
115+
116+
While typically this isn't a problem with technical documentation,
117+
try to avoid content that is "hidden" from search engines.
118+
This includes content hidden in images or videos
119+
which the crawler may not understand.
120+
For example, if you do have a video in your docs,
121+
make sure the rest of that page describes the content of the video.
122+
123+
When using images, make sure to set the image alt text or set a caption on figures.
124+
For Sphinx, the image and figure directives support this:
125+
126+
.. sourcecode:: rst
127+
128+
.. image:: your-image.png
129+
:alt: A description of this image
130+
131+
.. figure:: your-image.png
132+
133+
A caption for this figure
134+
135+
136+
Redirects
137+
~~~~~~~~~
138+
139+
Redirects tell search engines when content has moved.
140+
For example, if this guide moved from ``guides/technical-docs-seo-guide.html`` to ``guides/sphinx-seo-guide.html``,
141+
there will be a time period where search engines will still have the old URL in their index
142+
and will still be showing it to users.
143+
This is why it is important to update your own links within your docs as well as redirecting.
144+
If the hostname moved from docs.readthedocs.io to docs.readthedocs.org, this would be even more important!
145+
146+
Read the Docs supports a few different kinds of :doc:`user defined redirects </user-defined-redirects>`
147+
that should cover all the different cases such as redirecting a certain page for all project versions,
148+
or redirecting one version to another.
149+
150+
151+
Canonical URLs
152+
~~~~~~~~~~~~~~
153+
154+
Anytime very similar content is hosted at multiple URLs,
155+
it is pretty important to set a canonical URL.
156+
The canonical URL tells search engines where the original version
157+
your documentation is even if you have multiple versions on the internet
158+
(for example, incomplete translations or deprecated versions).
159+
160+
Read the Docs supports :doc:`setting the canonical URL </guides/canonical>`
161+
if you are using a :doc:`custom domain </custom_domains>`
162+
under :guilabel:`Admin` > :guilabel:`Domains`
163+
in the Read the Docs dashboard.
164+
165+
166+
Use a robots.txt file
167+
~~~~~~~~~~~~~~~~~~~~~
168+
169+
A ``robots.txt`` file is readable by crawlers
170+
and lives at the root of your site (eg. https://docs.readthedocs.io/robots.txt).
171+
It tells search engines which pages to crawl or not to crawl
172+
and can allow you to control how a search engine crawls your site.
173+
For example, you may want to request that search engines
174+
:ref:`ignore unsupported versions of your documentation <faq:How can I avoid search results having a deprecated version of my docs?>`
175+
while keeping those docs online in case people need them.
176+
177+
By default, Read the Docs serves a ``robots.txt`` for you.
178+
To customize this file, you can create a ``robots.txt`` file
179+
that is written to your documentation root on your default branch/version.
180+
181+
See the `Google's documentation on robots.txt <https://support.google.com/webmasters/answer/6062608>`_
182+
for additional details.
183+
184+
185+
Use a sitemap.xml file
186+
~~~~~~~~~~~~~~~~~~~~~~
187+
188+
A sitemap is a file readable by crawlers that contains a list of pages
189+
and other files on your site and some metadata or relationships about them
190+
(eg. https://docs.readthedocs.io/sitemap.xml).
191+
A good sitemaps provides information like how frequently a page or file is updated
192+
or any alternate language versions of a page.
193+
194+
Read the Docs generates a sitemap for you that contains the last time
195+
your documentation was updated as well as links to active versions, subprojects, and translations your project has.
196+
We have a small separate guide on :doc:`sitemaps </guides/sitemaps>`.
197+
198+
See the `Google docs on building a sitemap <https://support.google.com/webmasters/answer/183668>`_.
199+
200+
201+
Use meta tags
202+
~~~~~~~~~~~~~
203+
204+
Using a meta description allows you to customize how your pages
205+
look in search engine result pages.
206+
207+
Typically search engines will use the first few sentences of a page if no meta description is provided.
208+
In Sphinx, you can customize your meta description using the following RestructuredText:
209+
210+
.. sourcecode:: rst
211+
212+
.. meta::
213+
:description lang=en:
214+
Adding additional CSS or JavaScript files to your Sphinx documentation
215+
can let you customize the look and feel of your docs or add additional functionality.
216+
217+
218+
.. figure:: ../_static/images/guides/google-search-engine-results.png
219+
:align: center
220+
:figwidth: 80%
221+
:target: ../_static/images/guides/google-search-engine-results.png
222+
223+
Google search engine results showing a customized meta description
224+
225+
Moz.com, an authority on search engine optimization,
226+
makes the following suggestions for meta descriptions:
227+
228+
* Your meta description should have the most relevant content of the page.
229+
A searcher should know whether they've found the right page from the description.
230+
* The meta description should be between 150-300 characters
231+
and it may be truncated down to around 150 characters in some situations.
232+
* Meta descriptions are used for display but not for ranking.
233+
234+
Search engines don't always use your customized meta description
235+
if they think a snippet from the page is a better description.
236+
237+
Measure, iterate, & improve
238+
---------------------------
239+
240+
Search engines (and soon, Read the Docs itself) can provide useful data
241+
that you can use to improve your docs' ranking on search engines.
242+
243+
244+
Search engine feedback
245+
~~~~~~~~~~~~~~~~~~~~~~
246+
247+
`Google Search Console <https://search.google.com/search-console>`_ and
248+
`Bing Webmaster Tools <https://www.bing.com/webmaster/help/webmaster-guidelines-30fba23a>`_
249+
are tools for webmasters
250+
to get feedback about the crawling of their sites (or docs in our case).
251+
Some of the most valuable feedback these provide include:
252+
253+
* Google and Bing will show pages that were previously indexed that now give a 404
254+
(or more rarely a 500 or other status code).
255+
These will remain in the index for some time but will eventually be removed.
256+
This is a good opportunity to create a :ref:`redirect <guides/technical-docs-seo-guide:Redirects>`.
257+
* These tools will show any crawl issues with your documentation.
258+
* Search Console and Webmaster Tools will highlight security issues found
259+
or if Google or Bing took action against your site because they believe it is spammy.
260+
261+
262+
Analytics tools
263+
~~~~~~~~~~~~~~~
264+
265+
A tool like :doc:`Google Analytics </guides/google-analytics>`
266+
can give you feedback about the search terms people use to find your docs,
267+
your most popular pages, and lots of other useful data.
268+
269+
Search term feedback can be used to help you optimize content for certain keywords or for related keywords.
270+
For Sphinx documentation, or other technical documentation that has its own search features,
271+
analytics tools can also tell you the terms people search for within your site.
272+
273+
Knowing your popular pages can help you prioritize where to spend your SEO efforts.
274+
Optimizing your already popular pages can have a significant impact.
275+
276+
277+
External resources
278+
------------------
279+
280+
Here are a few additional resources to help you learn more about SEO
281+
and rank better with search engines.
282+
283+
* `Moz's beginners guide to SEO <https://moz.com/beginners-guide-to-seo>`_
284+
* `Google's Webmaster Guidelines <https://support.google.com/webmasters/answer/35769>`_
285+
* `Bing's Webmaster Guidelines <https://www.bing.com/webmaster/help/webmaster-guidelines-30fba23a>`_
286+
* `Google's SEO Starter Guide <https://support.google.com/webmasters/answer/7451184>`_

docs/privacy-policy.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,12 @@ and we encourage you to check back periodically.
166166
Payment processing
167167
++++++++++++++++++
168168

169-
Should you choose to become a `Supporter`_, purchase a `Gold Membership`_,
169+
Should you choose to become a `Supporter`_, purchase a `Gold membership`_,
170170
or become a subscriber to Read the Docs' commercial hosting product,
171171
your payment information and details will be processed by Stripe.
172172
Read the Docs does not store your payment information.
173173

174-
.. _Gold Membership: https://readthedocs.org/accounts/gold/
174+
.. _Gold membership: https://readthedocs.org/accounts/gold/
175175
.. _Supporter: https://readthedocs.org/sustainability/
176176

177177
Site monitoring

media/css/core.css

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -872,9 +872,12 @@ div.donate-stats h2 {
872872
margin: .5em 0em 1.5em 0em;
873873
}
874874

875+
#content ul.donate-about {
876+
margin-bottom: 1em;
877+
}
875878
ul.donate-about li {
876-
margin-left: 1em;
877-
list-style: inside;
879+
margin-left: 1.5em;
880+
list-style: initial;
878881
}
879882

880883
div.donate-stats-sm form {

0 commit comments

Comments
 (0)