Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

static asset images doesn't support versioning #1257

Closed
sunpeinju opened this issue Mar 4, 2019 · 3 comments
Closed

static asset images doesn't support versioning #1257

sunpeinju opened this issue Mar 4, 2019 · 3 comments

Comments

@sunpeinju
Copy link

🐛 Bug Report

I have a document which need to display some images, which are put under 'docs/assets' folder, and reference in the .md file like ![sample](assets/image1.png). Just followed the guide

Next, I want to create a new version of the document and need to use an updated version of the image. I executed docusaurus-version and old version .md files are backed up, but the 'docs/assets` folder isn't backed up to 'versioned_docs'. So two versions of md files reference to same one 'docs/assets' folder. I can't replace the image in the folder directly, since it impacts old document.

I think static assets of each version also need to be backed up by docusaurus-version. Current behavior looks like to be a bug.

Have you read the Contributing Guidelines on issues?

yes

To Reproduce

(Write your steps here:)

  1. put image under docs/assets folder
  2. write md file to reference this image
  3. run docusaurus-version to back up current version of documents
  4. .md file is backed up, but the asset folder isn't.

Expected behavior

(Write what you thought would happen.)

Actual Behavior

(Write what happened. Add screenshots, if applicable.)

Reproducible Demo

(Paste the link to an example repo, including a siteConfig.js, and exact instructions to reproduce the issue.)

@yangshun
Copy link
Contributor

yangshun commented Mar 4, 2019

Unfortunately, this is one of the known limitations of versioning. One workaround you can do is to never not the asset that is relied on in the old version and instead add the new asset under a different name.

We will address this bug and fix it properly in #789 when we rethink how we're implementing versions. You're welcome to send a patch for this bug 😄

@sunpeinju
Copy link
Author

@yangshun thank you!

@endiliey endiliey closed this as completed Mar 5, 2019
@ataft
Copy link
Contributor

ataft commented Feb 6, 2020

I see that versioning has been added to Docusaurus v2 now (https://v2.docusaurus.io/docs/versioning). However, it doesn't appear that this issue has been addressed.

Should this issue be re-opened?

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

No branches or pull requests

4 participants