-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Docs: remove link elements in builders other than HTML #133720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This change fixes EPUBs
This comment was marked as outdated.
This comment was marked as outdated.
We have three conditionals in a row (extra whitespace for clarity): {% if builder == "html" and enable_analytics %}
<script defer data-domain="docs.python.org" src="https://analytics.python.org/js/script.outbound-links.js"></script>
{% endif %}
{% if builder == "html" %}<link rel="canonical" href="https://docs.python.org/3/{{pagename}}.html">{% endif %}
{% if builder != "htmlhelp" %}
{% if pagename == 'whatsnew/changelog' and not embedded %}
<script type="text/javascript" src="{{ pathto('_static/changelog_search.js', 1) }}"></script>{% endif %}
{% endif %} Should that last If so, shall we factor that check out? Something along the lines of: {% if builder == "html" %}
{% if enable_analytics %}
<script defer data-domain="docs.python.org" src="https://analytics.python.org/js/script.outbound-links.js"></script>
{% endif %}
<link rel="canonical" href="https://docs.python.org/3/{{pagename}}.html">
{% if pagename == 'whatsnew/changelog' and not embedded %}
<script type="text/javascript" src="{{ pathto('_static/changelog_search.js', 1) }}"></script>{% endif %}
{% endif %} |
@Yhg1s this fixes a bug in docs epub build; would it be acceptable for backport to 3.12 ? |
Yeah, backporting to 3.12 is fine. |
Fixes epub build (cherry picked from commit 0afbd4e) Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
GH-134005 is a backport of this pull request to the 3.14 branch. |
Fixes epub build (cherry picked from commit 0afbd4e) Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
Fixes epub build (cherry picked from commit 0afbd4e) Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
GH-134006 is a backport of this pull request to the 3.13 branch. |
GH-134007 is a backport of this pull request to the 3.12 branch. |
This comment was marked as spam.
This comment was marked as spam.
) (#134005) Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
) (#134006) Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
) (#134007) Co-authored-by: Maciej Olko <maciej.olko@affirm.com>
Follow-up for #132220 (#132220 (comment)). This change fixes EPUB builds.
epubcheck
after this change results in 25 fewer errors. Could we please backport it for supported versions?Before:
After:
📚 Documentation preview 📚: https://cpython-previews--133720.org.readthedocs.build/