Skip to content

Commit ff11250

Browse files
authored
Merge pull request #89 from datasharingframework/dsf.dev_restructuring_2.0
fix redirect
2 parents 6bea31e + d510224 commit ff11250

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

docs/src/.vuepress/layouts/PageLayout.vue

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// import ParentLayout from '@vuepress/theme-default/layouts/Layout.vue'
33
import { Layout as ParentLayout, PageContent } from 'vuepress-theme-hope/client'
44
import { useRoute, useRouter } from "vue-router";
5-
import { ref } from 'vue'
5+
import { ref, onMounted } from 'vue'
66
77
const version = ref("");
88
@@ -11,8 +11,10 @@ function setVersionBasedOnCurrentPath() : void {
1111
if (route.path.startsWith('/operations/')) {
1212
const input = route.path.substring('/operations/'.length);
1313
const firstSlash = input.indexOf("/");
14-
const result = firstSlash !== -1 ? input.slice(0, firstSlash) : input;
15-
14+
var result = firstSlash !== -1 ? input.slice(0, firstSlash) : input;
15+
if (result === "latest") {
16+
result = document.querySelector("#version-select > option[latest='true']").value;
17+
}
1618
version.value = result;
1719
1820
@@ -29,13 +31,20 @@ router.afterEach((_to, _from) => {
2931
setVersionBasedOnCurrentPath();
3032
});
3133
32-
setVersionBasedOnCurrentPath();
34+
onMounted(() => {
35+
setVersionBasedOnCurrentPath();
36+
})
3337
3438
function navigateToNewVersion() {
3539
const input = route.path.substring('/operations/'.length);
3640
const firstSlash = input.indexOf("/");
3741
const result = firstSlash !== -1 ? input.slice(firstSlash + 1) : "";
38-
router.push('/operations/' + version.value + "/" + result);
42+
if (version.value === document.querySelector("#version-select > option[latest='true']").value) {
43+
router.push('/operations/' + "latest" + "/" + result);
44+
} else {
45+
router.push('/operations/' + version.value + "/" + result);
46+
47+
}
3948
}
4049
4150
</script>
@@ -46,8 +55,7 @@ function navigateToNewVersion() {
4655
<div class="version-selector" v-if="route.path.startsWith('/operations/')">
4756
<label class="vp-sidebar-header" for="version-select"><strong>Version:</strong> </label>
4857
<select id="version-select" class="vp-sidebar-header" v-model="version" @change="navigateToNewVersion">
49-
<option value="next">next (2.0.0-M3)</option>
50-
<option value="latest">latest (1.8.0)</option>
58+
<option value="v1.8.0" latest="true">latest (1.8.0)</option>
5159
<option value="v1.7.1">1.7.1</option>
5260
<option value="v1.7.0">1.7.0</option>
5361
<option value="v1.6.0">1.6.0</option>
@@ -61,6 +69,7 @@ function navigateToNewVersion() {
6169
<option value="v1.2.0">1.2.0</option>
6270
<option value="v1.1.0">1.1.0</option>
6371
<option value="v1.0.0">1.0.0</option>
72+
<option value="v2.0.0-M3">2.0.0-M3</option>
6473
</select></div>
6574
</template>
6675
<PageContent id="main-content" class="vp-page"/>

docs/src/operations/next

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/src/operations/process-plugin-deployment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ title: Process Plugin Deployment
33
icon: plugin
44
---
55

6-
<meta http-equiv="refresh" content="0;url=./v1/latest/maintain/install-plugins.html">
6+
<meta http-equiv="refresh" content="0;url=./latest/maintain/install-plugins.html">

0 commit comments

Comments
 (0)