Skip to content

Disallow package docs except for latest#496

Merged
oraNod merged 4 commits intoansible-community:mainfrom
oraNod:disallow-eol-versions
Nov 27, 2025
Merged

Disallow package docs except for latest#496
oraNod merged 4 commits intoansible-community:mainfrom
oraNod:disallow-eol-versions

Conversation

@oraNod
Copy link
Contributor

@oraNod oraNod commented Nov 17, 2025

The purpose of this change is to disallow crawlers from all Ansible package docs versions except for the latest version, currently 13. We want to do this so that search results return for latest versions.

Copy link
Contributor

@samccann samccann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm but we could go all the way up to Ansible 10 (and soon Ansible 12).

Prevent agents from crawling and indexing eol versions of the package
docs. This improves SEO by reducing the number of pages that can't be
indexed. This change also helps funnel users to the latest docs version.
@oraNod oraNod force-pushed the disallow-eol-versions branch from f1c252c to 50aee97 Compare November 20, 2025 17:39
@oraNod oraNod changed the title Disallow eol versions Disallow package docs except for latest Nov 20, 2025
Copy link
Contributor

@samccann samccann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@oraNod
Copy link
Contributor Author

oraNod commented Nov 21, 2025

@samccann I've been rethinking disallowing the supported package versions.

Consider the RTD docs about version states: https://docs.readthedocs.com/platform/latest/versions.html#version-states

The default behaviour is to disallow hidden versions in robots.txt. Only active versions are indexed.

We need to explicitly declare whatever rules are needed because I don't think subprojects get their own robots.txt and we're using a custom one. But I think we should consider allowing any of the versions that are in the flyout widget on RTD, which follows the same pattern as the supported branches in the source repo.

@oraNod
Copy link
Contributor Author

oraNod commented Nov 21, 2025

Here are the versions on the flyout widget:

image

This corresponds to the branches in https://github.com/ansible/ansible-documentation/blob/2aada29638a9ad769e3a8c7d66868a4408e0d9b7/.github/workflows/pip-compile-dev.yml

@samccann What do you think about hiding the devel build on RTD? That build will still be available but do we want devel in the flyout if we're disallowing it in robots.txt?

@oraNod
Copy link
Contributor Author

oraNod commented Nov 21, 2025

Maybe if we hide devel in the flyout menu we can also remove this from the banner:

You are reading the devel version of the Ansible documentation - this version is not guaranteed stable. Use the version selection to the left if you want the latest (stable) released version.

@gundalow gundalow marked this pull request as draft November 21, 2025 18:12
@gundalow
Copy link
Contributor

Not to make this more complex, though I agree we should think about /devel/ vs /latest/.
I could extend my RTD Bulk Fix script to point to /latest/ on all links that exist. Once case I can think we might want /devel/ is links to roadmaps.

I've marked this PR as draft till Don had decided what he wants to do here.

@oraNod oraNod marked this pull request as ready for review November 24, 2025 18:54
@oraNod
Copy link
Contributor Author

oraNod commented Nov 24, 2025

Not to make this more complex, though I agree we should think about /devel/ vs /latest/. I could extend my RTD Bulk Fix script to point to /latest/ on all links that exist. Once case I can think we might want /devel/ is links to roadmaps.

I've marked this PR as draft till Don had decided what he wants to do here.

I'm happy with these changes now. We can disallow crawlers/indexing for everything in the package docs except for latest. The versions will still be available in the RTD flyout menu where humans will look for them.

@oraNod
Copy link
Contributor Author

oraNod commented Nov 24, 2025

On a side note I'm also thinking about adding a disallow rule for projects/ansible-core/* but we can do that in a follow on PR because it is a separate project.

@samccann
Copy link
Contributor

For devel (whether to have it in the flyout) - this imo should be a community decision. I Think either way the banner needs to stay. Even with the website saying devel, people would confuse it with /latest/ and thus we added the banner.

@oraNod
Copy link
Contributor Author

oraNod commented Nov 26, 2025

For devel (whether to have it in the flyout) - this imo should be a community decision. I Think either way the banner needs to stay. Even with the website saying devel, people would confuse it with /latest/ and thus we added the banner.

Yeah, that's fair enough. I can start a thread in the forum. What about disallowing devel in robots.txt though? Do you think we should hold off?

@gundalow
Copy link
Contributor

Is there anything left, or can we merge this as-is?

@oraNod oraNod merged commit 7f77e07 into ansible-community:main Nov 27, 2025
5 checks passed
@oraNod
Copy link
Contributor Author

oraNod commented Nov 27, 2025

Let's just merge this. I think we should also just keep devel in the version switcher. Probably the only people who will look at that will be folks in the SC etc. And we will still have the banner.

Thanks for the reviews @gundalow and @samccann

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments