Skip to content

Commit df9a0ee

Browse files
committed
Rewrite search engine indexing section
Add Cancel builds programmatically section Add Cancel builds on a branch section
1 parent 35372cf commit df9a0ee

File tree

1 file changed

+51
-4
lines changed

1 file changed

+51
-4
lines changed

docs/contributing/documentation/admins.md

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,55 @@ After logging in to your Read the Docs account, you can import your project.
118118
1. Click {guilabel}`Finish`.
119119
Read the Docs will redirect you to the project details, and start building the docs.
120120
121-
For most Plone projects, you will not want to Read the Docs to publish the `latest` or other specific versions.
122-
Plone projects currently self-host their official documentation.
123121
124-
1. For the version that you want to deactivate, click its {guilabel}`…` icon, and select {guilabel}`Configure version`.
125-
1. Toggle the {guilabel}`Active` option off, and click {guilabel}`Update version`.
122+
### Search engine indexing
123+
124+
Many Plone projects currently self-host their official documentation at {doc}`/index`.
125+
These projects get indexed by search engines.
126+
127+
For pull request previews, unsupported branches or versions, or other situations, you most likely do not want search engines to index your documentation.
128+
Your options include the following.
129+
130+
- Deactivate your build
131+
- Hide your build
132+
- Create a custom {file}`robots.txt` file to discourage, but not absolutely prevent, search engine indexing
133+
134+
For the last option, you can configure Sphinx to copy the {file}`robots.txt` file.
135+
However, if you want to have two versions of a {file}`robots.txt` file—say one that allows indexing of your official documentation and another that discourages indexing—you can configure your automation to copy it into place with a command such as the following.
136+
137+
```shell
138+
cp source-path/block-robots.txt docs-root-path/robots.txt
139+
```
140+
141+
```{seealso}
142+
- [Automation rules](https://docs.readthedocs.io/en/stable/automation-rules.html)
143+
- [Versions](https://docs.readthedocs.io/en/stable/versions.html)
144+
- [Managing versions automatically](https://docs.readthedocs.io/en/stable/guides/automation-rules.html)
145+
- [`robots.txt` support](https://docs.readthedocs.io/en/stable/reference/robots.html)
146+
```
147+
148+
149+
### Cancel builds programmatically
150+
151+
You might want to cancel a build programmatically when certain conditions are met.
152+
You can do this through your {file}`.readthedocs.yaml` file.
153+
Read the Docs covers a few scenarios in its documentation, [Cancel build based on a condition](https://docs.readthedocs.io/en/stable/build-customization.html#cancel-build-based-on-a-condition).
154+
155+
156+
#### Cancel builds on a branch
157+
158+
If you have pull request preview builds enabled, any pull request to any branch will trigger a build.
159+
If you do not want to build documentation on a specific branch, you can cancel a build programmatically through your {file}`.readthedocs.yaml` file.
160+
161+
```yaml
162+
version: 2
163+
build:
164+
os: "ubuntu-22.04"
165+
tools:
166+
python: "3.12"
167+
jobs:
168+
post_checkout:
169+
# Cancel the Read the Docs build
170+
# https://docs.readthedocs.io/en/stable/build-customization.html#cancel-build-based-on-a-condition
171+
- exit 183;
172+
```

0 commit comments

Comments
 (0)