Added noindex meta tag to untranslated docs pages#2473
Open
vidhiii1711 wants to merge 7 commits intodjango:mainfrom
Open
Added noindex meta tag to untranslated docs pages#2473vidhiii1711 wants to merge 7 commits intodjango:mainfrom
vidhiii1711 wants to merge 7 commits intodjango:mainfrom
Conversation
bmispelon
requested changes
Mar 11, 2026
Member
bmispelon
left a comment
There was a problem hiding this comment.
Hi,
Have you checked that this changes work on your local version? I don't understand where is_translated is defined.
We also need a two tests: one for a translated page to check the meta tag is not present, one for an untranslated page to check the meta tag is present.
Thanks!
djangoproject/templates/base.html
Outdated
| <script src="{% static "js/mod/switch-dark-mode.js" %}"></script> | ||
| {% block head_extra %}{% endblock head_extra %} | ||
| {% block head_extra %} | ||
| {% if not is_translated %} |
Member
There was a problem hiding this comment.
Unless I've missed it, this variable is_translated is never defined anywhere, so this will not work.
Author
There was a problem hiding this comment.
Hi, thanks for the review!
I'll update the implementation to use the correct variable from the docs system and I'll also add the two tests you suggested.
I'll push the updates shortly. Thanks!
|
unsubscribe pls
…On Thu, Mar 12, 2026 at 2:43 AM Baptiste Mispelon ***@***.***> wrote:
***@***.**** requested changes on this pull request.
Hi,
Have you checked that this changes work on your local version? I don't
understand where is_translated is defined.
We also need a two tests: one for a translated page to check the meta tag
is not present, one for an untranslated page to check the meta tag is
present.
Thanks!
------------------------------
In djangoproject/templates/base.html
<#2473 (comment)>
:
> @@ -42,7 +42,12 @@
<link rel="stylesheet" href="{% static "css/output.css" %}" >
<script src="{% static "js/mod/switch-dark-mode.js" %}"></script>
- {% block head_extra %}{% endblock head_extra %}
+ {% block head_extra %}
+ {% if not is_translated %}
Unless I've missed it, this variable is_translated is never defined
anywhere, so this will not work.
—
Reply to this email directly, view it on GitHub
<#2473 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJGAATUMRRI44EEDFTDBFYD4QHJJPAVCNFSM6AAAAACSYSTO32VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTSMZSGU3DIOJWHA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a
noindexmeta tag to untranslated documentation pages,ensuring they are excluded from search engine indexing without relying
on robots.txt.
This aligns with search engine best practices and keeps translated
documentation pages discoverable.
Fixes #877