vuejs / vitepress

Vite & Vue powered static site generator.
https://vitepress.dev
MIT License
12.76k stars 2.07k forks source link

Versioning #109

Open fimbault opened 3 years ago

fimbault commented 3 years ago

Is your feature request related to a problem? Please describe. Related to documentation versioning

Describe the solution you'd like A way to version a set of markdown documents

Describe alternatives you've considered Similar to VuePress Plugin or Docusaurus2

brc-dd commented 2 years ago

Well there is another workaround. Move your old docs to a subdomain. Then you can write config like this:

import { defineConfig } from 'vitepress'

export default defineConfig({
  themeConfig: {
    nav: [
      {
        text: 'v3 (stable)',
        items: [
          {
            text: 'v2 (legacy)',
            link: 'https://v2.vuejs.org/'
          }
        ]
      }
    ]
  }
})

It will be rendered like this:

image

jcstein commented 1 year ago

hi again @brc-dd - do you have recommended practices on moving old versions to subdomain? if you do, have you seen anyone do this on github pages? we're thinking of moving another docs site to vitepress, but this is the one remaining blocker

DMiradakis commented 11 months ago

+1 this would really be essential. I'm trying to think of how to build this in VitePress, but I'm not sure at the moment.

drwpow commented 10 months ago

I’m pretty sure this is just done with multiple sidebars. Just move your versioned docs to a subfolder with the version in them.

You can then add a link to the nav where a user selects the version, and on change, the correct sidebar will show.

IMB11 commented 9 months ago

I've utilized multiple sidebars, a nav switcher etc. to create a versioning example that should suffice for most projects until proper versioning support is added.

You can view it here: https://github.com/IMB11/vitepress-versioning Now a plugin on NPM! https://www.npmjs.com/package/vitepress-versioning-plugin

Im unsure how to make it a library, or whether it's even worth being a library

ciscoo commented 8 months ago

Well there is another workaround. Move your old docs to a subdomain. Then you can write config like this:

I would not consider this a workaround primarily because it assumes you have a domain. For users that use GitHub Pages without a custom domain, it is not possible.

A workaround, in my opinion, is something that can be done purely within the constraints of VitePress. The approaches that @drwpow and @IMB11 provided I would consider workarounds.

IMB11 commented 8 months ago

I actually ended up turned my example into a proper plugin/library: https://www.npmjs.com/package/vitepress-versioning-plugin

ajiho commented 2 months ago

I actually ended up turned my example into a proper plugin/library: https://www.npmjs.com/package/vitepress-versioning-plugin

Thank you for your work, but I think we need Vitepress official to implement it better. Your package seems to have a different version control effect from the one provided by docusaurus

IMB11 commented 2 months ago

Well, working without an official plugin API is extremely difficult - there's some whacky stuff going on in that plugin that would be 10x easier if there was a standardized approach to plugins.

ajiho commented 2 months ago

@brc-dd Will version control functionality be introduced in the future? I have tried the version control feature of docusaurus and I think it would be a satisfactory answer. Can the Vitepress team migrate it?

javierjulio commented 1 day ago

I've been migrating ActiveAdmin's documentation to Vitepress. The setup, experience and the overall docs are just fantastic, thank you! ❤️ The one issue I've run into is we do need the capability or an alternative for versioning without requiring a subdomain. If Vitepress could support some way of doing documentation versioning, that would be great and helpful feature.