Skip to content

Commit

Permalink
Update robots.txt to crawl only latest version of documentation (#761)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincbeck authored Apr 17, 2023
1 parent 61fb310 commit 7065f15
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 3 deletions.
3 changes: 1 addition & 2 deletions CONTRIBUTE.md
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,7 @@ To release a new documentation, follow these steps:
2. To build documentation, run following commands:
```bash
cd "${AIRFLOW_REPO}" && git checkout "${AIRFLOW_VERSION}"
cd "${AIRFLOW_REPO}" && pip3 install -e '.[doc]'
cd "${AIRFLOW_REPO}/docs/" && bash build.sh
cd "${AIRFLOW_REPO}" && breeze build-docs'
```
3. Copy generated files from `${AIRFLOW_REPO}/docs/_build/html` to `${AIRFLOW_SITE_REPO}/docs-archive/<version>/`
Expand Down
46 changes: 46 additions & 0 deletions sphinx_airflow_theme/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,52 @@ In order to start working with the theme, please follow the instructions below.
./docs.sh build && ./docs.sh preview
```

# Generate Airflow documentation with Sphinx theme changes

If you made some modifications to Sphinx theme and want to generate Airflow documentation to check the end results,
please follow these steps:

1. In `airflow-site` repository, build Airflow website:
```shell script
./site.sh build-site
```

2. Package the Sphinx theme in a `whl` file:
```shell script
cd ./sphinx_airflow_theme
python3 setup.py sdist bdist_wheel
```

3. (Optional) Double-check your modifications to the Sphinx theme are in the `whl` file:
```shell script
pip install wheel
wheel unpack ./sphinx_airflow_theme-0.0.11-py3-none-any.whl
```

4. Copy the `whl` file to `files` directory in `airflow` repository:
```shell script
cp ./sphinx_airflow_theme-0.0.11-py3-none-any.whl ${AIRFLOW_REPO}/files/
```

5. In `airflow` repository, initiate a new breeze environment:
```shell script
breeze
```

6. In the breeze container, generate the documentation after installing the theme:
```shell script
pip install /files/sphinx_airflow_theme-0.0.11-py3-none-any.whl --force-reinstall
# Generate Airflow documentation only. If you need to generate the whole documentation (all providers),
# you can do it using `/opt/airflow/scripts/in_container/run_docs_build.sh`. It takes longer to execute.
/opt/airflow/scripts/in_container/run_docs_build.sh --package-filter apache-airflow
```

7. Verify the documentation generated is correct and includes your modifications. The documentation is generated in
`docs/_build/docs/`. If you generated Airflow documentation only, you can check the results in
`docs/_build/docs/apache-airflow/latest/`.



# Install developer version

To install the latest development version of a theme, run:
Expand Down
2 changes: 1 addition & 1 deletion sphinx_airflow_theme/sphinx_airflow_theme/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from os import path
from sphinx.application import Sphinx

__version__ = '0.0.11'
__version__ = '0.0.12'
__version_full__ = __version__


Expand Down
3 changes: 3 additions & 0 deletions sphinx_airflow_theme/sphinx_airflow_theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,9 @@
<link rel="prev" title="{{ prev.title|striptags|e }}" href="{{ prev.link|e }}" />
{%- endif %}
{%- endblock %}

<link rel="canonical" href="https://airflow.apache.org/docs/{{ project }}/stable/{{ pagename }}.html" />

<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
Expand Down

0 comments on commit 7065f15

Please sign in to comment.