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

Unexpected behavior of the versioning plugin #46

Open
rexwangcc opened this issue Sep 30, 2020 · 2 comments
Open

Unexpected behavior of the versioning plugin #46

rexwangcc opened this issue Sep 30, 2020 · 2 comments

Comments

@rexwangcc
Copy link

rexwangcc commented Sep 30, 2020

First of all, thank you for all of the great work you have done! I arrived here following the threads all the way from vuejs/vuepress#1018

I have switched our theme from the default one to Titanium Theme for 2 reasons, the separate right-side content sidebar and the versioning support. While the right-side content sidebar works as a charm (side note: it'd would be even better and more convenient if it could be turned on from config.js for a whole directory than having to modify each individual md file's frontmatter especially when you already have thousnads of doc files.), we ran into some unexpected behaviors with the versioning plugin:

  1. The version switch doesn't work.
  2. The sidebar disappears unexpectedly when switching between versions.

In case I didn't setup the layout correctly in our own project, I did an experiment with a clone of this repo itself seeing if it could be reproduced by:

git clone [email protected]:appcelerator/docs-devkit.git
cd ./docs-devkit/packages/docs
yarn
yarn run createVersion 0.1.4
yarn run createVersion 0.1.5
...
yarn run createVersion 0.1.19
yarn dev

And both of the aforementioned can be reproduced.

I patched what's proposed in #43 to the installed plugin in node_nodules, and that seems to fix 1., but 2. is still there (the sidebar is only showing up on next version and the pre-existing 0.1.3 version but not there in any other created versions)

Screen Shot 2020-09-30 at 1 50 14 PM
Screen Shot 2020-09-30 at 1 50 20 PM
Screen Shot 2020-09-30 at 1 50 28 PM

I'm planning to look into the source code of the plugin when I have time later, but it would be really appreciated if you are available to shed some light or even release a fix. Thanks!

@janvennemann
Copy link
Contributor

janvennemann commented Oct 8, 2020

Hi, thanks for reporting this issue. We are aware of a couple of issues regarding the versioning plugin if you have more than two versions. Unfortunately we didn't have time yet to investigate and fix those. We are currently working on migrating our own docs to VuePress and are not at the stage yet to use the versioning plugin, so it has seen little attention lately.

Judging from a quick look at #43 i think it only works if you don't use the locales feature. Are you using locales? Anyway i'll try to give this a deeper look next week.

While the right-side content sidebar works as a charm (side note: it'd would be even better and more convenient if it could be turned on from config.js for a whole directory than having to modify each individual md file's frontmatter especially when you already have thousnads of doc files.) ...

You can easily do so with a little plugin and set the frontmatter programmatically. That way you don't have to touch your existing files: https://github.com/appcelerator/titanium-docs/blob/master/docs/.vuepress/guides-content-sidebar.js

@rexwangcc
Copy link
Author

Thanks for you reply!

Judging from a quick look at #43 i think it only works if you don't use the locales feature. Are you using locales? Anyway i'll try to give this a deeper look next week.
Yes, we are using i18n and have more than 1 locale, so it will not work for our use case after taking a closer look.

We ended up implementing a light-weight script that simply copies the versioned docs per release and tweak the nav links to separate the versioning. Also thanks for the pointer above!

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

2 participants