Skip to content

feat: SEO improvements - #1538

Merged
jorgepiloto merged 22 commits into
mainfrom
feat/seo-improvements
Sep 7, 2026
Merged

jorgepiloto merged 22 commits into
mainfrom
feat/seo-improvements

Conversation

@jorgepiloto

@jorgepiloto jorgepiloto commented Sep 3, 2026

Copy link
Copy Markdown
Member

This pull-request fixes our SEO strategy by:

  • Documentation SEO behavior now indexes only /version/stable/; /version/dev, archived /version/X.Y, and /version/pull pages are set to noindex, follow.
  • Added _doc-gen-noindex to inject robots noindex metadata on all non-stable versioned pages while preserving crawl of links.
  • Updated canonical generation to emit canonical tags only when a matching version/stable page exists, avoiding canonicals that point to missing pages.
  • Reworked sitemap generation to exclude noindex and utility pages, keep .html URLs, use file mtime for , and remove ignored changefreq and priority fields.
  • Updated robots.txt generation to wildcard rules: Disallow /version/, Allow /version/stable/, and Disallow /pull/, with optional extra-disallow entries.
  • Wired both dev and stable deploy actions to the updated helpers and fixed stable-presence gating for sitemap creation in dev deploy.
  • Result: canonical tags, sitemap entries, and crawler directives are aligned to reduce duplicate-content and thin-content indexing signals on docs.pyansys sites.

@jorgepiloto
jorgepiloto requested a review from a team as a code owner September 3, 2026 07:55
@github-actions github-actions Bot added enhancement General improvements to existing features docs Issues related to documentation labels Sep 3, 2026
@jorgepiloto
jorgepiloto force-pushed the feat/seo-improvements branch from a8b91b4 to 76b1a13 Compare September 3, 2026 08:12
@jorgepiloto
jorgepiloto marked this pull request as draft September 3, 2026 08:22
@jorgepiloto
jorgepiloto marked this pull request as ready for review September 3, 2026 08:39

@RobPasMue RobPasMue left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall they look good! I'm assuming you've tested them on a repo directly. Do you have a log of the executions?

jorgepiloto and others added 6 commits September 4, 2026 10:50
When ``use-latest-index-in-landing-page`` is true, the deploy actions
copy ``version/{stable|dev|prerelease}/index.html`` to ``index.html``
at the site root and rewrite its internal links. In prerelease-only or
first-time deploys the copy source has already been stamped with a
``noindex, follow`` robots meta by ``_doc-gen-noindex``, and the
canonical originally set for its versioned URL was either replaced by a
different value or removed altogether. As a result the root landing
page inherited the source's ``noindex`` and lost its canonical, hiding
the site from search engines that only see the root URL.

Add a post-copy step to both ``doc-deploy-dev`` and
``doc-deploy-stable`` that strips any inherited robots meta from
``index.html`` and enforces ``<link rel="canonical"
href="https://${CNAME}/">``. The step is idempotent, a no-op in the
normal stable-exists case, and is gated by the same
``use-latest-index-in-landing-page`` guard as the copy step.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When the only artifact being deployed is a prerelease with no prior
"version/stable" or "version/dev" tree in gh-pages, "_doc-gen-canonical"
used to exit 1 because it could not find a landing baseline, and
"_doc-gen-versions-page" would fail because its first "cp" step also
assumed one of those directories existed. Both actions now warn and
skip gracefully so the pipeline can complete on that scenario.

The root landing page canonical is enforced separately by the
"Ensure the root landing page is indexable and self-canonical" step
in "doc-deploy-dev" and "doc-deploy-stable", so no coverage is lost.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pull-request preview documentation previously relied on the top-level
robots.txt Disallow directive for /pull/ to keep search engines away
from every preview under pull/<pr>/. That disallow works for
well-behaved crawlers, but it does not stop crawlers that discover
preview URLs from external backlinks (for example the PR comment that
advertises the preview URL) from indexing them, and it does not remove
pages that were already indexed before this rule existed.

Add _doc-gen-noindex invocations that stamp "noindex, follow" meta
tags directly into every pull-preview HTML page:

- _pr-doc-deployment stamps every new preview at deploy time.
- doc-deploy-dev and doc-deploy-stable retroactively stamp all
  remaining pull/*/ dirs so previews deployed before this feature also
  drop out of search indexes. Both are gated on the presence of at
  least one pull HTML so the step is a no-op when there is nothing to
  stamp. Both are safe to re-run because the noindex step strips and
  reinjects the meta tag.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update the "_doc-gen-noindex" action description to reflect that the
action is now invoked with "version-directory: pull" as well, and add
a v11 migration guide entry that lists every user-visible SEO change:
noindex on non-stable and pull-preview pages, wildcard "robots.txt",
sitemap noindex-aware skipping and extended default exclude list,
"include-sitemap" input, and root-landing self-canonical enforcement.

Also drop a stray blank-line-only change under the v6 section that was
introduced earlier in the branch.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jorgepiloto
jorgepiloto marked this pull request as draft September 4, 2026 17:53
@jorgepiloto

Copy link
Copy Markdown
Member Author

Converting this to a draft. @SMoraisAnsys would like to review this pull before merging it.

@SMoraisAnsys SMoraisAnsys left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, just requesting a minor change related to private actions and the use of required inputs only. Otherwise, LGTM. Thanks for the work guys !

Comment thread _doc-gen-noindex/action.yml Outdated
Comment thread _doc-gen-robots/action.yml Outdated
Comment thread _doc-gen-robots/action.yml
Comment thread _doc-gen-sitemap/action.yml Outdated
Comment thread doc-deploy-dev/action.yml
Comment thread doc-deploy-dev/action.yml
Comment thread doc-deploy-stable/action.yml
Comment thread doc-deploy-stable/action.yml
Comment thread doc-deploy-stable/action.yml
Comment thread _pr-doc-deployment/action.yml
jorgepiloto and others added 5 commits September 7, 2026 10:57
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jorgepiloto and others added 7 commits September 7, 2026 11:49
The pull-request preview cleanup loop calls gh pr comment on every closed PR
directory. Under set -eo pipefail, a locked PR, a missing pull-requests: write
scope, or a transient API failure would abort the deploy and leave the closed
directory in place; the next run then retries the same closed PR and either
crashes again or spams the same notice.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The canonical rewrite used sed 's|<link rel="canonical".*>|...|g' which is
greedy and, on minified or single-line HTML, matches through to the last '>'
on the line, silently deleting every intervening tag. Constrain to
[^>]* so only the canonical tag itself is replaced.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
actions/download-artifact does not preserve source mtimes, so every file's
mtime collapses to the artifact extraction time. Per Google's docs, an
inaccurate <lastmod> causes them to distrust and eventually ignore the
signal for the whole site. Emit <lastmod> only for the site-root entry,
which is legitimately 'now' for the deploy.

Also restrict the noindex scan to the <head> window so 'noindex' inside a
<script> body, an HTML comment, or a substring like 'noindexing-guide' no
longer causes false-positive page drops.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
A caller passing 'version/' would build the find filter as
'! -path "version//stable/*"' which does not match 'version/stable/foo.html',
causing every stable page to be silently noindex-stamped. Strip any trailing
slash before building the filter and reject an empty input as a no-op.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Drop the mention of 'optional include-sitemap default true' and the
suggestion to override 'exclude' on the private _doc-gen-sitemap action,
which are no longer accurate after the required-input policy landed.
Document that per-URL <lastmod> is intentionally omitted.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The doc-style CI reported a Vale.Spelling error on 'backlinks' at
doc/source/migrations/index.rst:89. Add 'backlinks' to the ANSYS vocabulary
accept-list (regex form '[Bb]acklinks?' to cover singular/plural and
casing) since it is a well-established SEO term. Also drop 'will' from
line 93 to silence the Google.Will style warning on the same file.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jorgepiloto
jorgepiloto marked this pull request as ready for review September 7, 2026 12:20
@jorgepiloto
jorgepiloto merged commit 5ea9ba0 into main Sep 7, 2026
91 checks passed
@jorgepiloto
jorgepiloto deleted the feat/seo-improvements branch September 7, 2026 12:43
moe-ad pushed a commit that referenced this pull request Sep 7, 2026
Co-authored-by: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Issues related to documentation enhancement General improvements to existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants