@viteplus/versions 1.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,153 +1,183 @@
1
1
  # @viteplus/versions
2
2
 
3
- [![Documentation](https://img.shields.io/badge/Documentation-orange?logo=typescript&logoColor=f5f5f5)](https://vitepulse.github.io/versions/)
4
- [![npm version](https://img.shields.io/npm/v/@vitepulse/versions.svg)](https://www.npmjs.com/package/@vitepulse/versions)
3
+ [![Documentation](https://img.shields.io/badge/Documentation-orange?logo=typescript&logoColor=f5f5f5)](https://viteplus.github.io/versions/)
4
+ [![npm version](https://img.shields.io/npm/v/@viteplus/versions.svg)](https://www.npmjs.com/package/@viteplus/versions)
5
5
  [![License: MPL 2.0](https://img.shields.io/badge/License-MPL_2.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)
6
- [![Node.js CI](https://github.com/vitepulse/versions/actions/workflows/node.js.yml/badge.svg)](https://github.com/vitepulse/versions/actions/workflows/node.js.yml)
7
- [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/vitepulse/versions)
6
+ [![Node.js CI](https://github.com/viteplus/versions/actions/workflows/node.js.yml/badge.svg)](https://github.com/viteplus/versions/actions/workflows/node.js.yml)
7
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/viteplus/versions)
8
8
 
9
- A plugin for VitePress that enables versioned documentation, including automatic versioned routes, sidebars, navigation, and a version switcher component.
9
+ @viteplus/versions is a powerful VitePress plugin that enables versioned documentation with built-in localization support,
10
+ seamless navigation between versions, and intelligent URL routing.
10
11
 
11
- ## Installation
12
+ ## ✨ Features
13
+
14
+ - **Version Management**: Effortlessly manage multiple documentation versions
15
+ - **Localization**: Full multi-language support with version-aware localization
16
+ - **Smart URL Routing**: Automatic path rewriting for clean, predictable URLs
17
+ - **Version Switcher**: Built-in component for navigating between versions
18
+ - **Flexible Configuration**: Customize navigation, sidebar, and URL structures per version/locale
19
+ - **VitePress**: support 2.0.0-alpha.12
20
+
21
+ ## 📦 Installation
12
22
 
13
- Install the plugin using your preferred package manager:
14
23
  ```bash
15
- pnpm install @viteplus/versions
16
- # or
17
24
  npm install @viteplus/versions
18
25
  # or
19
26
  yarn add @viteplus/versions
27
+ # or
28
+ pnpm add @viteplus/versions
20
29
  ```
21
30
 
22
- ## Basic Setup
23
- 1. Ensure Relative Links
24
-
25
- All links in your `markdown` files must be relative.
26
- This is critical because the plugin relies on relative paths to determine the correct versioned file to link to.
27
-
28
- - Example: Linking `docs/guide/advanced-setup.md` from `docs/guide/getting-started.md`:
29
- ```markdown
30
- ./advanced-setup.md
31
- ```
32
-
33
- - Example: Linking `docs/help/faq.md` from `docs/guide/getting-started.md`:
34
- ```markdown
35
- ../help/faq.md
36
- ```
37
-
38
- > [!CAUTION]
39
- > Absolute links like /guide/getting-started will break versioned navigation.
31
+ ## 🚀 Quick Start
40
32
 
41
- 2. Configure Versioning
42
-
43
- Replace defineConfig in .vitepress/config.ts with `defineVersionedConfig`:
33
+ 1. Create a VitePress project
34
+ 2. Install @viteplus/versions
35
+ 3. Configure your documentation using `defineVersionedConfig`
44
36
 
45
37
  ```ts
38
+ // .vitepress/config.ts
46
39
  import { defineVersionedConfig } from '@viteplus/versions';
47
40
 
48
41
  export default defineVersionedConfig({
49
- root: 'docs', // root folder
50
- title: 'SomeProject',
51
- base: '/SomeProject/', // in case github page that have prefix
52
- srcDir: 'src',
53
- versioning: {
54
- latestVersion: '1.0.0',
42
+ title: 'My Project Documentation',
43
+ description: 'Documentation with version control',
44
+
45
+ // Version configuration
46
+ versionsConfig: {
47
+ current: 'v2.0.0',
48
+ versionSwitcher: {
49
+ text: 'Version',
50
+ includeCurrentVersion: true
55
51
  }
52
+ },
53
+
54
+ // Standard VitePress configuration
55
+ themeConfig: {
56
+ nav: [
57
+ { text: 'Guide', link: '/guide/' },
58
+ { component: 'VersionSwitcher' }
59
+ ],
60
+ // ...
61
+ }
56
62
  });
57
63
  ```
58
64
 
59
- 3. Version Switcher Component
65
+ ## 📂 Project Structure
66
+
67
+ ```text
68
+ docs/
69
+ ├── .vitepress/
70
+ │ └── config.ts
71
+ ├── src/ // Current version docs
72
+ │ ├── en/ // English (default locale)
73
+ │ │ ├── index.md
74
+ │ │ └── guide/
75
+ │ └── de/ // German locale
76
+ │ ├── index.md
77
+ │ └── guide/
78
+ └── archive/ // Archived versions
79
+ └── v1.0/
80
+ ├── en/
81
+ │ ├── index.md
82
+ │ └── guide/
83
+ └── de/
84
+ ├── index.md
85
+ └── guide/
60
86
 
61
- To use a custom version switcher component:
87
+ ```
62
88
 
63
- 1. Import and register it in your theme config:
89
+ ## 🌐 Localization Support
64
90
 
65
91
  ```ts
66
- /**
67
- * Import will remove at compile time
68
- */
69
-
70
- import type { VNode } from '@vue/runtime-core';
71
- import type { Awaitable, Theme } from 'vitepress';
72
-
73
- /**
74
- * Styles
75
- */
76
-
77
- import './style.css';
78
-
79
- /**
80
- * Imports
81
- */
82
-
83
- import { h } from 'vue';
84
- import DefaultTheme from 'vitepress/theme';
85
- import VersionSwitcher from '@viteplus/versions/components/version-switcher.component.vue';
86
-
87
- export default {
88
- extends: DefaultTheme,
89
- Layout: (): VNode => {
90
- return h(DefaultTheme.Layout, null, {
91
- });
92
+ export default defineVersionedConfig({
93
+ // ...
94
+ locales: {
95
+ root: {
96
+ lang: 'en',
97
+ label: 'English',
98
+ themeConfig: {
99
+ nav: [
100
+ { text: 'Home', link: '/' },
101
+ { text: 'Guide', link: '/guide/' }
102
+ ]
103
+ }
92
104
  },
93
- enhanceApp({ app }): Awaitable<void> {
94
- app.component('VersionSwitcher', VersionSwitcher);
105
+ de: {
106
+ lang: 'de',
107
+ label: 'Deutsch',
108
+ themeConfig: {
109
+ nav: [
110
+ { text: 'Startseite', link: '/' },
111
+ { text: 'Anleitung', link: '/guide/' }
112
+ ]
113
+ }
95
114
  }
96
- } satisfies Theme;
115
+ }
116
+ });
117
+
97
118
  ```
98
119
 
99
- 2. Add it to your navbar:
120
+ ## 🔄 Version-Specific Navigation
100
121
 
101
122
  ```ts
102
- themeConfig: {
103
- versionSwitcher: false, // hide default switcher
104
- nav: [
105
- ...,
106
- {
107
- component: 'VersionSwitcher',
108
- },
109
- ]
110
- }
123
+ export default defineVersionedConfig({
124
+ themeConfig: {
125
+ nav: {
126
+ // Default navigation for all versions
127
+ root: [
128
+ { text: 'Home', link: '/' },
129
+ { text: 'Guide', link: '/guide/' }
130
+ ],
131
+
132
+ // Navigation only for v1.0
133
+ 'v1.0': [
134
+ { text: 'Home', link: '/' },
135
+ { text: 'Legacy API', link: '/legacy-api/' }
136
+ ]
137
+ }
138
+ }
139
+ });
140
+
111
141
  ```
112
142
 
113
- ## Troubleshooting
114
- 1. Sidebar Cannot Be an Array
143
+ ## 🛠️ Custom URL Structure
115
144
 
116
145
  ```ts
117
- // ❌ Incorrect
118
- sidebar: [
119
- { text: '1.0.0', link: '/' },
120
- ]
121
-
122
- // ✅ Correct
123
- sidebar: {
124
- '/': [
125
- { text: '1.0.0', link: '/' },
126
- ]
127
- }
146
+ export default defineVersionedConfig({
147
+ versionsConfig: {
148
+ // ...
149
+ hooks: {
150
+ rewritesHook: (source, version, locale) => {
151
+ // Custom URL structure (version first, then locale)
152
+ return `${version}/${locale}/${source}`;
153
+ }
154
+ }
155
+ }
156
+ });
128
157
  ```
129
158
 
130
- ## Acknowledgments
159
+ ## 📚 Documentation
131
160
 
132
- I would like to express my gratitude to those who inspired and supported this project:
133
- - `@IMB11`, for the original vitepress-versioning-plugin
161
+ For comprehensive guides and reference, check our [documentation](https://viteplus.github.io/versions/).
134
162
 
163
+ - [Localization](https://viteplus.github.io/versions//guide/locales.html)
164
+ - [URL Path Rewrites](https://viteplus.github.io/versions//guide/rewrites.html)
165
+ - [Version Switcher](https://viteplus.github.io/versions//guide/switcher.html)
166
+ - [Configuration Guide](https://viteplus.github.io/versions//guide/configuration.html)
135
167
 
136
- ## Documentation
168
+ ## 🤝 Contributing
137
169
 
138
- For complete API documentation, examples, and guides, visit: [Documentation](https://vitepulse.github.io/versions/)
170
+ We welcome contributions! Please see our [contributing guidelines](CONTRIBUTING.md) for details.
139
171
 
140
- ## Compatibility
172
+ ## 📄 License
141
173
 
142
- - Node.js 20+
143
- - All modern browsers (via bundlers)
144
- - TypeScript 4.5+
145
- -
146
- ## Contributing
174
+ This project is licensed under the [MIT License](LICENSE).
147
175
 
148
- Contributions are welcome!\
149
- Please see our [Contributing Guide](CONTRIBUTING.md) for details.
176
+ ## 💖 Acknowledgements
150
177
 
151
- ## License
178
+ - [VitePress](https://vitepress.dev/) - The amazing static site generator this plugin extends
179
+ - [Vue.js](https://vuejs.org/) - The progressive JavaScript framework
180
+ - [Vite](https://vitejs.dev/) - Next generation frontend tooling
181
+ - `@IMB11` - for the original vitepress-versioning-plugin
152
182
 
153
- This project is licensed under the Mozilla Public License 2.0 see the [LICENSE](LICENSE) file for details.
183
+ Made with ❤️ by the @viteplus team
@@ -13,189 +13,209 @@ import { useData, useRouter } from 'vitepress';
13
13
  import VPFlyout from 'vitepress/dist/client/theme-default/components/VPFlyout.vue';
14
14
  import VPMenuLink from 'vitepress/dist/client/theme-default/components/VPMenuLink.vue';
15
15
 
16
+ /**
17
+ * Interfaces
18
+ */
19
+
16
20
  interface VersioningPlugin {
17
- versions: Array<string>,
18
- latestVersion: string
21
+ versions: Array<string>;
22
+ currentVersion: string;
19
23
  }
20
24
 
21
- const props = defineProps<{
22
- versioningPlugin: VersioningPlugin
23
- screenMenu?: boolean
24
- }>()
25
-
26
- const router = useRouter()
27
- const { site } = useData()
28
-
29
- // Optimize version detection using find() instead of for loop
30
- const currentVersion = computed(() => {
31
- const basePath = site.value.base
32
- const { versions, latestVersion } = props.versioningPlugin
25
+ /**
26
+ * Defines
27
+ */
33
28
 
34
- // Find the first version that matches the current path
35
- const matchedVersion = versions.find(version =>
36
- router.route.path.startsWith(`${ basePath }${ version }/`)
37
- )
29
+ const router = useRouter();
30
+ const isOpen = ref(false);
31
+ const { site } = useData();
32
+ const props = defineProps<{
33
+ versioningPlugin: VersioningPlugin
34
+ screenMenu?: boolean
35
+ }>();
38
36
 
39
- return matchedVersion || latestVersion
40
- })
37
+ const getActiveVersion = computed(() => {
38
+ const path = router.route.data.relativePath.split('/');
39
+ const { versions, currentVersion } = props.versioningPlugin
40
+ const index = (site.value.lang === path[0]) ? versions.indexOf(path[1]) : versions.indexOf(path[0]);
41
41
 
42
- // Create a reusable menu item generator to DRY up template
43
- const createVersionMenuItem = (version: string) => ({
44
- text: version,
45
- link: version === props.versioningPlugin.latestVersion ? '/' : `/${ version }/`
42
+ return (index === -1) ? currentVersion : versions[index];
46
43
  })
47
44
 
48
- const isOpen = ref(false)
49
- const toggle = () => {
50
- isOpen.value = !isOpen.value
45
+ function createVersionMenuItem(version: string): { text: string, link: string } {
46
+ const { versions, currentVersion } = props.versioningPlugin
47
+ const relativePath = router.route.data.relativePath
48
+ const pathSegments = relativePath.split('/')
49
+
50
+ let newPathSegments: Array<string>;
51
+ if (version !== currentVersion) {
52
+ const langSegment = pathSegments.includes(site.value.lang) ? site.value.lang : undefined
53
+ newPathSegments = langSegment
54
+ ? [langSegment, version, ...pathSegments.slice(1)]
55
+ : [version, ...pathSegments];
56
+ } else {
57
+ if (versions.includes(pathSegments[0])) {
58
+ newPathSegments = pathSegments.slice(1)
59
+ } else if (versions.includes(pathSegments[1])) {
60
+ newPathSegments = [...pathSegments.slice(0, 1), ...pathSegments.slice(2)]
61
+ } else {
62
+ newPathSegments = [...pathSegments]
63
+ }
64
+ }
65
+
66
+ return { text: version, link: `/${ newPathSegments.join('/') }` }
67
+ }
68
+
69
+ function toggle() {
70
+ return isOpen.value = !isOpen.value;
51
71
  }
52
72
  </script>
53
73
 
54
74
  <template>
55
- <!-- Desktop version flyout -->
56
- <VPFlyout
57
- v-if="!screenMenu"
58
- class="VPVersionSwitcher"
59
- icon="vpi-versioning"
60
- :button="currentVersion"
61
- label="Switch Version"
62
- >
63
- <div class="items">
64
- <!-- Only show latest version link if we're not already on latest -->
65
- <VPMenuLink
66
- v-if="currentVersion !== versioningPlugin.latestVersion"
67
- :item="createVersionMenuItem(versioningPlugin.latestVersion)"
68
- />
69
- <!-- Show all version links except current version -->
70
- <template v-for="version in versioningPlugin.versions" :key="version">
71
- <VPMenuLink
72
- v-if="currentVersion !== version"
73
- :item="createVersionMenuItem(version)"
74
- />
75
- </template>
76
- </div>
77
- </VPFlyout>
78
-
79
- <!-- Mobile version dropdown -->
80
- <div v-else class="VPScreenVersionSwitcher" :class="{ open: isOpen }">
81
- <button
82
- class="button"
83
- aria-controls="navbar-group-version"
84
- :aria-expanded="isOpen"
85
- @click="toggle"
75
+ <!-- Desktop version flyout -->
76
+ <VPFlyout
77
+ v-if="!screenMenu"
78
+ class="VPVersionSwitcher"
79
+ icon="vpi-versioning"
80
+ :button="getActiveVersion"
81
+ label="Switch Version"
86
82
  >
83
+ <div class="items">
84
+ <!-- Only show latest version link if we're not already on latest -->
85
+ <VPMenuLink
86
+ v-if="getActiveVersion !== versioningPlugin.currentVersion"
87
+ :item="createVersionMenuItem(versioningPlugin.currentVersion)"
88
+ />
89
+ <!-- Show all version links except current version -->
90
+ <template v-for="version in versioningPlugin.versions" :key="version">
91
+ <VPMenuLink
92
+ v-if="getActiveVersion !== version"
93
+ :item="createVersionMenuItem(version)"
94
+ />
95
+ </template>
96
+ </div>
97
+ </VPFlyout>
98
+
99
+ <!-- Mobile version dropdown -->
100
+ <div v-else class="VPScreenVersionSwitcher" :class="{ open: isOpen }">
101
+ <button
102
+ class="button"
103
+ aria-controls="navbar-group-version"
104
+ :aria-expanded="isOpen"
105
+ @click="toggle"
106
+ >
87
107
  <span class="button-text">
88
108
  <span class="vpi-versioning icon"/>Switch Version
89
109
  </span>
90
- <span class="vpi-plus button-icon"/>
91
- </button>
92
-
93
- <div id="navbar-group-version" class="items">
94
- <!-- Always show latest version link -->
95
- <VPMenuLink :item="createVersionMenuItem(versioningPlugin.latestVersion)"/>
96
- <!-- Show all version links -->
97
- <VPMenuLink
98
- v-for="version in versioningPlugin.versions"
99
- :key="version"
100
- :item="createVersionMenuItem(version)"
101
- />
110
+ <span class="vpi-plus button-icon"/>
111
+ </button>
112
+
113
+ <div id="navbar-group-version" class="items">
114
+ <!-- Always show latest version link -->
115
+ <VPMenuLink :item="createVersionMenuItem(versioningPlugin.currentVersion)"/>
116
+ <!-- Show all version links -->
117
+ <VPMenuLink
118
+ v-for="version in versioningPlugin.versions"
119
+ :key="version"
120
+ :item="createVersionMenuItem(version)"
121
+ />
122
+ </div>
102
123
  </div>
103
- </div>
104
124
  </template>
105
125
 
106
126
  <style>
107
127
  /* Versioning icon styling */
108
128
  .vpi-versioning.option-icon {
109
- margin-right: 2px !important;
129
+ margin-right: 2px !important;
110
130
  }
111
131
 
112
132
  .vpi-versioning {
113
- --icon: url("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iNjRweCIgaGVpZ2h0PSI2NHB4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHN0cm9rZS13aWR0aD0iMi4yIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGNvbG9yPSIjMDAwMDAwIj48cGF0aCBkPSJNMTcgN0MxOC4xMDQ2IDcgMTkgNi4xMDQ1NyAxOSA1QzE5IDMuODk1NDMgMTguMTA0NiAzIDE3IDNDMTUuODk1NCAzIDE1IDMuODk1NDMgMTUgNUMxNSA2LjEwNDU3IDE1Ljg5NTQgNyAxNyA3WiIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2Utd2lkdGg9IjIuMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48L3BhdGg+PHBhdGggZD0iTTcgN0M4LjEwNDU3IDcgOSA2LjEwNDU3IDkgNUM5IDMuODk1NDMgOC4xMDQ1NyAzIDcgM0M1Ljg5NTQzIDMgNSAzLjg5NTQzIDUgNUM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2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjwvcGF0aD48L3N2Zz4=")
114
134
  }
115
135
  </style>
116
136
 
117
137
  <style scoped>
118
138
  /* Component styling with minor optimizations */
119
139
  .VPVersionSwitcher {
120
- display: flex;
121
- align-items: center;
140
+ display: flex;
141
+ align-items: center;
122
142
  }
123
143
 
124
144
  .icon {
125
- padding: 8px;
145
+ padding: 8px;
126
146
  }
127
147
 
128
148
  .title {
129
- padding: 0 24px 0 12px;
130
- line-height: 32px;
131
- font-size: 14px;
132
- font-weight: 700;
133
- color: var(--vp-c-text-1);
149
+ padding: 0 24px 0 12px;
150
+ line-height: 32px;
151
+ font-size: 14px;
152
+ font-weight: 700;
153
+ color: var(--vp-c-text-1);
134
154
  }
135
155
 
136
156
  /* Mobile version switcher styles */
137
157
  .VPScreenVersionSwitcher {
138
- border-bottom: 1px solid var(--vp-c-divider);
139
- height: 48px;
140
- overflow: hidden;
141
- transition: border-color 0.5s;
158
+ border-bottom: 1px solid var(--vp-c-divider);
159
+ height: 48px;
160
+ overflow: hidden;
161
+ transition: border-color 0.5s;
142
162
  }
143
163
 
144
164
  .VPScreenVersionSwitcher .items {
145
- visibility: hidden;
165
+ visibility: hidden;
146
166
  }
147
167
 
148
168
  .VPScreenVersionSwitcher.open {
149
- padding-bottom: 10px;
150
- height: auto;
169
+ padding-bottom: 10px;
170
+ height: auto;
151
171
  }
152
172
 
153
173
  .VPScreenVersionSwitcher.open .items {
154
- visibility: visible;
174
+ visibility: visible;
155
175
  }
156
176
 
157
177
  .VPScreenVersionSwitcher.open .button {
158
- padding-bottom: 6px;
159
- color: var(--vp-c-brand-1);
178
+ padding-bottom: 6px;
179
+ color: var(--vp-c-brand-1);
160
180
  }
161
181
 
162
182
  .VPScreenVersionSwitcher.open .button-icon {
163
- /*rtl:ignore*/
164
- transform: rotate(45deg);
183
+ /*rtl:ignore*/
184
+ transform: rotate(45deg);
165
185
  }
166
186
 
167
187
  .VPScreenVersionSwitcher button .icon {
168
- margin-right: 8px;
188
+ margin-right: 8px;
169
189
  }
170
190
 
171
191
  .button {
172
- display: flex;
173
- justify-content: space-between;
174
- align-items: center;
175
- padding: 12px 4px 11px 0;
176
- width: 100%;
177
- line-height: 24px;
178
- font-size: 14px;
179
- font-weight: 500;
180
- color: var(--vp-c-text-1);
181
- transition: color 0.25s;
192
+ display: flex;
193
+ justify-content: space-between;
194
+ align-items: center;
195
+ padding: 12px 4px 11px 0;
196
+ width: 100%;
197
+ line-height: 24px;
198
+ font-size: 14px;
199
+ font-weight: 500;
200
+ color: var(--vp-c-text-1);
201
+ transition: color 0.25s;
182
202
  }
183
203
 
184
204
  .button:hover {
185
- color: var(--vp-c-brand-1);
205
+ color: var(--vp-c-brand-1);
186
206
  }
187
207
 
188
208
  .button-icon {
189
- transition: transform 0.25s;
209
+ transition: transform 0.25s;
190
210
  }
191
211
 
192
212
  /* Group styling */
193
213
  .group:first-child {
194
- padding-top: 0;
214
+ padding-top: 0;
195
215
  }
196
216
 
197
217
  .group + .group,
198
218
  .group + .item {
199
- padding-top: 4px;
219
+ padding-top: 4px;
200
220
  }
201
221
  </style>