Skip to content

Commit 6290200

Browse files
authored
Merge pull request #6135 from readthedocs/update-extra-path-url
Fix link to html_extra_path
2 parents 15984b6 + 6dec803 commit 6290200

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

docs/faq.rst

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ To accomplish this, you can add a ``robots.txt`` file to your documentation's ro
257257

258258

259259
Minimal example of ``robots.txt``
260-
+++++++++++++++++++++++++++++++++
260+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
261261

262262
::
263263

@@ -270,22 +270,28 @@ Minimal example of ``robots.txt``
270270
See `Google's docs`_ for its full syntax.
271271

272272
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.
274273

274+
Setup
275+
~~~~~
275276

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:
278283

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+
++++++
281286

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``.
282289

283290
MkDocs
284-
~~~~~~
291+
++++++
285292

286293
MkDocs needs the ``robots.txt`` to be at the directory defined at `docs_dir`_ config.
287294

288-
289295
.. _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
291297
.. _docs_dir: https://www.mkdocs.org/user-guide/configuration/#docs_dir

0 commit comments

Comments
 (0)