pingcap / pingcap/website-docs

Image CDN should be aware of different doc versions

Open
#317 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
23
Forks
33
Avg merge
3d 5h
Merged PRs (30d)
7

Description

Describe the bug
Currently, changing the version of the document does not load images from specific branch.
i.e. all versions share the same image source from CDN https://download.pingcap.com

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
For each version maintained, have corresponding CDN path that stores the images from their branch
Take docs v5.2 as example:

Screenshots

  • dev
    image

  • v5.2
    image

The src of the image is always the same

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Related code: https://github.com/pingcap/website-docs/blob/e612ad0095cea2c2e40d179d80eb3df253bf7ea1/packages/download/utils.js#L17

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at packages/download/utils.js around line 17 and compare how the selected document version determines its image source. Verify the release-5.2 example against the media directory and CDN path; done means each maintained version resolves images from its corresponding versioned CDN location.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.