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

feature: add ability to independently version static assets #3

Open
pa-eps opened this issue Nov 22, 2021 · 0 comments
Open

feature: add ability to independently version static assets #3

pa-eps opened this issue Nov 22, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@pa-eps
Copy link
Contributor

pa-eps commented Nov 22, 2021

The current functionality of this library takes care of versioning docs assets (i.e. docs/assets/ directory) since that's the convention from Docusaurus V1. But, there are other "static assets" that are currently not being versioned. In the source repo, those are typically stored in website/static/ directory. For example: we want to serve some portions of statically generated site along side docusaurus (i.e. javadocs generated from a project's source code). Only way to effectively serve those generated html files is to save them as static assets (i.e. website/static/javadocs/ directory). But, we need a way to version those when regular markdown documents are versioned.

Proposal

Add the ability to version static assets when markdown documents are being versioned. When the CLI of this library is invoked, the user should be able to provide additional parameter to specify which directory within website/static/ dir should be versioned. This should be optional parameter. As part of the overall versioning process, additional tasks will be performed if static assets needs to be versioned:

  1. If versioning is being done for the first time:
    1. Copy the given static asset directory as a versioned asset. For example: copy website/static/javadocs dir to website/static/javadocs/<version-value> dir
    2. Clone website/static/javadocs/<version-value> to website/static/javadocs/next dir
    3. Update markdown documents containing links to those static assets:
      • Update markdown files in docs/ directory with relative links to those static assets to point to "next version" (i.e. change ../javadocs/<remaining-file-path> to ../../javadocs/next/<remaining-file-path>
      • Update markdown files in newly created versions in website/versioned_docs/version-<version-value>/ directory with relative links to those static assets to point to "versioned files" (i.e. change ../javadocs/<remaining-file-path> to ../javadocs/<version-value>/<remaining-file-path>
  2. If versioning for subsequent times (i.e. not a first version):
    1. Copy the given static asset directory as a versioned asset. For example: copy website/static/javadocs/next dir to website/static/javadocs/<version-value> dir
    2. Update markdown documents containing links to those static assets:
      • Update markdown files in newly created versions in website/versioned_docs/version-<version-value>/ directory with relative links to those static assets to point to "versioned files" (i.e. change ../javadocs/<remaining-file-path> to ../javadocs/<version-value>/<remaining-file-path>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant