starlight-versions 0.5.4 → 0.5.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # starlight-versions
2
2
 
3
+ ## 0.5.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#42](https://github.com/HiDeoo/starlight-versions/pull/42) [`3b68fbc`](https://github.com/HiDeoo/starlight-versions/commit/3b68fbc511dbe80c7d4b79ebe5ebc0b9f8d06c9d) Thanks [@mkurapov](https://github.com/mkurapov)! - Fixes potential issue with link generation in multilingual projects.
8
+
3
9
  ## 0.5.4
4
10
 
5
11
  ### Patch Changes
package/libs/markdown.ts CHANGED
@@ -196,7 +196,11 @@ function addVersionToLink(link: string, file: VFile) {
196
196
  }
197
197
 
198
198
  const segments = link.split('/')
199
- segments.splice(1, 0, file.data.version.slug)
199
+
200
+ let slugVersionIndex = 1
201
+ if (file.data.locale && segments[1] === file.data.locale) slugVersionIndex = 2
202
+
203
+ segments.splice(slugVersionIndex, 0, file.data.version.slug)
200
204
 
201
205
  if (hasBase) {
202
206
  segments.splice(1, 0, stripLeadingSlash(base))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starlight-versions",
3
- "version": "0.5.4",
3
+ "version": "0.5.5",
4
4
  "license": "MIT",
5
5
  "description": "Starlight plugin to version documentation pages.",
6
6
  "author": "HiDeoo <github@hideoo.dev> (https://hideoo.dev)",