@@ -257,7 +257,7 @@ To accomplish this, you can add a ``robots.txt`` file to your documentation's ro
257
257
258
258
259
259
Minimal example of ``robots.txt ``
260
- +++++++++++++++++++++++++++++++++
260
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
261
261
262
262
::
263
263
@@ -270,22 +270,28 @@ Minimal example of ``robots.txt``
270
270
See `Google's docs `_ for its full syntax.
271
271
272
272
This file has to be served as is under ``/robots.txt ``.
273
- Depending if you are using Sphinx or MkDocs, you will need a different configuration for this.
274
273
274
+ Setup
275
+ ~~~~~
275
276
276
- Sphinx
277
- ~~~~~~
277
+ The ``robots.txt `` file will be served from the **default version ** of your Project.
278
+ This is because the ``robots.txt `` file is served at the top-level of your domain,
279
+ so we must choose a version to find the file in.
280
+ The **default version ** is the best place to look for it.
281
+
282
+ Sphinx and Mkdocs both have different ways of outputting static files in the build:
278
283
279
- Sphinx uses ` html_extra `_ option to add static files to the output.
280
- You need to create a `` robots.txt `` file and put it under the path defined in `` html_extra ``.
284
+ Sphinx
285
+ ++++++
281
286
287
+ Sphinx uses `html_extra_path `_ option to add static files to the output.
288
+ You need to create a ``robots.txt `` file and put it under the path defined in ``html_extra_path ``.
282
289
283
290
MkDocs
284
- ~~~~~~
291
+ ++++++
285
292
286
293
MkDocs needs the ``robots.txt `` to be at the directory defined at `docs_dir `_ config.
287
294
288
-
289
295
.. _Google's docs : https://support.google.com/webmasters/answer/6062608
290
- .. _ html_extra : https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_extra_path
296
+ .. _ html_extra_path : https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_extra_path
291
297
.. _docs_dir : https://www.mkdocs.org/user-guide/configuration/#docs_dir
0 commit comments