Skip to content

The slow local documentation build might be due to downloading Weblate's icons. #11645

@saierXP

Description

@saierXP

When I tried to build the Chinese documentation locally, I found that there were hundreds of download requests to Weblate during the build process, and the amount of data requested was the same.

Image

Investigating conf.py, I discovered that it should be the Weblate widget in rst_epilog that needs to download images. After downloading the Chinese Weblate images locally and changing the image address to an absolute local path, the build time was reduced to within a few minutes instead of more than half hour.

Additionally, I only found one reference to a weblate-widget in index.rts. Is there another way to implement it instead of downloading weblate images for every document page?

godot-docs/conf.py

Lines 309 to 318 in c37184a

rst_epilog = """
.. |weblate_widget| image:: https://hosted.weblate.org/widgets/godot-engine/{image_locale}/godot-docs/287x66-white.png
:alt: Translation status
:target: https://hosted.weblate.org/engage/godot-engine{target_locale}/?utm_source=widget
:width: 287
:height: 66
""".format(
image_locale="-" if language == "en" else language,
target_locale="" if language == "en" else "/" + language,
)

The built index page still needs to be online to download this translation status icon, which is completely pointless.
Image

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions