pingcap / website-docs

The next generation of PingCAP Docs. Powered by Gatsby ⚛️.
https://docs.pingcap.com/
MIT License
22 stars 33 forks source link

Image CDN should be aware of different doc versions #317

Open jeffwang0516 opened 1 year ago

jeffwang0516 commented 1 year ago

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

The src of the image is always the same

Desktop (please complete the following information):

Smartphone (please complete the following information):

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

shczhen commented 1 year ago

Hi @jeffwang0516 , thanks for your advise.

In current docs scenario, it's better to keep image consist. It is beneficial to the reuse of static resources. Besides, it's a big mission for doc team to update all image references.

But your advice is still very suitable for our next doc website idea. It's clear and helpful if we maintain common/versioned static media files for doc.