Skip to content

docs: optimize Chinese RTD asset paths - #10

Merged
lkygithub merged 1 commit into
mainfrom
docs/rtd-zh-assets
Sep 24, 2026
Merged

lkygithub merged 1 commit into
mainfrom
docs/rtd-zh-assets

Conversation

@lkygithub

Copy link
Copy Markdown
Collaborator

Description

  • Optimize raw HTML image references during Chinese locale-only Read the Docs builds.
  • Derive the output-relative image prefix from each Markdown file's nesting depth, so the landing page and nested pages both retain valid asset URLs.
  • Add a CI build that reproduces the zh-cn/latest Read the Docs layout and verifies the generated logo and architecture image references.

Motivation and Context

Read the Docs publishes the Chinese locale-only build at /zh-cn/<version>/. The Chinese landing page previously retained source-tree-relative raw HTML paths, causing its assets to resolve outside the version directory. Nested Markdown pages already resolve their image paths correctly, so the build-time adjustment is limited to matching raw HTML src attributes and accounts for each page's depth.

How has this been tested?

  • mkdocs build --strict --config-file apps/rlark/mkdocs.yml for the normal bilingual site (73 HTML pages).
  • Simulated the Read the Docs zh-cn/latest environment and ran a strict locale-only build (37 HTML pages).
  • Verified the landing page emits images/logo-zh.png and images/architecture-zh.svg.
  • Verified the architecture page retains ../images/architecture-zh.svg.
  • Verified both generated asset files exist and repeated patch execution is idempotent.
  • Validated the same candidate tree with an online Read the Docs test project.

Types of changes

  • Documentation update
  • CI coverage for the Chinese Read the Docs build
  • Breaking change

Checklist

  • My code follows the code style of this project.
  • The Read the Docs build behavior is covered by CI assertions.
  • All relevant new and existing documentation builds passed.

Adjust raw HTML image references for Chinese locale-only builds while preserving nested-page paths.

Add a CI build that validates the generated homepage and architecture assets.

Signed-off-by: Likang Yu <likangyu@likangyudebijibendiannao.local>
@lkygithub
lkygithub merged commit 93b96b4 into main Sep 24, 2026
22 checks passed
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.

1 participant