Skip to content

fix redirect #89

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

Merged
merged 2 commits into from
Jun 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions docs/src/.vuepress/layouts/PageLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// import ParentLayout from '@vuepress/theme-default/layouts/Layout.vue'
import { Layout as ParentLayout, PageContent } from 'vuepress-theme-hope/client'
import { useRoute, useRouter } from "vue-router";
import { ref } from 'vue'
import { ref, onMounted } from 'vue'

const version = ref("");

Expand All @@ -11,8 +11,10 @@ function setVersionBasedOnCurrentPath() : void {
if (route.path.startsWith('/operations/')) {
const input = route.path.substring('/operations/'.length);
const firstSlash = input.indexOf("/");
const result = firstSlash !== -1 ? input.slice(0, firstSlash) : input;

var result = firstSlash !== -1 ? input.slice(0, firstSlash) : input;
if (result === "latest") {
result = document.querySelector("#version-select > option[latest='true']").value;
}
version.value = result;


Expand All @@ -29,13 +31,20 @@ router.afterEach((_to, _from) => {
setVersionBasedOnCurrentPath();
});

setVersionBasedOnCurrentPath();
onMounted(() => {
setVersionBasedOnCurrentPath();
})

function navigateToNewVersion() {
const input = route.path.substring('/operations/'.length);
const firstSlash = input.indexOf("/");
const result = firstSlash !== -1 ? input.slice(firstSlash + 1) : "";
router.push('/operations/' + version.value + "/" + result);
if (version.value === document.querySelector("#version-select > option[latest='true']").value) {
router.push('/operations/' + "latest" + "/" + result);
} else {
router.push('/operations/' + version.value + "/" + result);

}
}

</script>
Expand All @@ -46,8 +55,7 @@ function navigateToNewVersion() {
<div class="version-selector" v-if="route.path.startsWith('/operations/')">
<label class="vp-sidebar-header" for="version-select"><strong>Version:</strong> </label>
<select id="version-select" class="vp-sidebar-header" v-model="version" @change="navigateToNewVersion">
<option value="next">next (2.0.0-M3)</option>
<option value="latest">latest (1.8.0)</option>
<option value="v1.8.0" latest="true">latest (1.8.0)</option>
<option value="v1.7.1">1.7.1</option>
<option value="v1.7.0">1.7.0</option>
<option value="v1.6.0">1.6.0</option>
Expand All @@ -61,6 +69,7 @@ function navigateToNewVersion() {
<option value="v1.2.0">1.2.0</option>
<option value="v1.1.0">1.1.0</option>
<option value="v1.0.0">1.0.0</option>
<option value="v2.0.0-M3">2.0.0-M3</option>
</select></div>
</template>
<PageContent id="main-content" class="vp-page"/>
Expand Down
1 change: 0 additions & 1 deletion docs/src/operations/next

This file was deleted.

2 changes: 1 addition & 1 deletion docs/src/operations/process-plugin-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ title: Process Plugin Deployment
icon: plugin
---

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