Skip to content

Commit 7065f15

Browse files
authored
Update robots.txt to crawl only latest version of documentation (#761)
1 parent 61fb310 commit 7065f15

File tree

4 files changed

+51
-3
lines changed

4 files changed

+51
-3
lines changed

CONTRIBUTE.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,7 @@ To release a new documentation, follow these steps:
424424
2. To build documentation, run following commands:
425425
```bash
426426
cd "${AIRFLOW_REPO}" && git checkout "${AIRFLOW_VERSION}"
427-
cd "${AIRFLOW_REPO}" && pip3 install -e '.[doc]'
428-
cd "${AIRFLOW_REPO}/docs/" && bash build.sh
427+
cd "${AIRFLOW_REPO}" && breeze build-docs'
429428
```
430429
431430
3. Copy generated files from `${AIRFLOW_REPO}/docs/_build/html` to `${AIRFLOW_SITE_REPO}/docs-archive/<version>/`

sphinx_airflow_theme/README.md

+46
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,52 @@ In order to start working with the theme, please follow the instructions below.
4646
./docs.sh build && ./docs.sh preview
4747
```
4848
49+
# Generate Airflow documentation with Sphinx theme changes
50+
51+
If you made some modifications to Sphinx theme and want to generate Airflow documentation to check the end results,
52+
please follow these steps:
53+
54+
1. In `airflow-site` repository, build Airflow website:
55+
```shell script
56+
./site.sh build-site
57+
```
58+
59+
2. Package the Sphinx theme in a `whl` file:
60+
```shell script
61+
cd ./sphinx_airflow_theme
62+
python3 setup.py sdist bdist_wheel
63+
```
64+
65+
3. (Optional) Double-check your modifications to the Sphinx theme are in the `whl` file:
66+
```shell script
67+
pip install wheel
68+
wheel unpack ./sphinx_airflow_theme-0.0.11-py3-none-any.whl
69+
```
70+
71+
4. Copy the `whl` file to `files` directory in `airflow` repository:
72+
```shell script
73+
cp ./sphinx_airflow_theme-0.0.11-py3-none-any.whl ${AIRFLOW_REPO}/files/
74+
```
75+
76+
5. In `airflow` repository, initiate a new breeze environment:
77+
```shell script
78+
breeze
79+
```
80+
81+
6. In the breeze container, generate the documentation after installing the theme:
82+
```shell script
83+
pip install /files/sphinx_airflow_theme-0.0.11-py3-none-any.whl --force-reinstall
84+
# Generate Airflow documentation only. If you need to generate the whole documentation (all providers),
85+
# you can do it using `/opt/airflow/scripts/in_container/run_docs_build.sh`. It takes longer to execute.
86+
/opt/airflow/scripts/in_container/run_docs_build.sh --package-filter apache-airflow
87+
```
88+
89+
7. Verify the documentation generated is correct and includes your modifications. The documentation is generated in
90+
`docs/_build/docs/`. If you generated Airflow documentation only, you can check the results in
91+
`docs/_build/docs/apache-airflow/latest/`.
92+
93+
94+
4995
# Install developer version
5096
5197
To install the latest development version of a theme, run:

sphinx_airflow_theme/sphinx_airflow_theme/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from os import path
1919
from sphinx.application import Sphinx
2020

21-
__version__ = '0.0.11'
21+
__version__ = '0.0.12'
2222
__version_full__ = __version__
2323

2424

sphinx_airflow_theme/sphinx_airflow_theme/layout.html

+3
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,9 @@
297297
<link rel="prev" title="{{ prev.title|striptags|e }}" href="{{ prev.link|e }}" />
298298
{%- endif %}
299299
{%- endblock %}
300+
301+
<link rel="canonical" href="https://airflow.apache.org/docs/{{ project }}/stable/{{ pagename }}.html" />
302+
300303
<!-- Matomo -->
301304
<script>
302305
var _paq = window._paq = window._paq || [];

0 commit comments

Comments
 (0)