Skip to content

static asset images doesn't support versioning #1257

Closed

Description

@sunpeinju

🐛 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.)

Activity

  1. yangshun commented on Mar 4, 2019

    @yangshun
    Contributor

    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 😄

  2. sunpeinju commented on Mar 4, 2019

    @sunpeinju
    Author

    @yangshun thank you!

  3. ataft commented on Feb 6, 2020

    @ataft
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions