Skip to content

Commit 527e42c

Browse files
committed
minor adjustments
1 parent 7e804b9 commit 527e42c

File tree

14 files changed

+435
-1072
lines changed

14 files changed

+435
-1072
lines changed

docs/src/.vuepress/client.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { defineClientConfig } from 'vuepress/client'
2+
import { Layout as ParentLayout, NotFound } from "vuepress-theme-hope/client";
3+
4+
import Layout from './layouts/PageLayout.vue'
5+
6+
export default defineClientConfig({
7+
layouts: {
8+
//ParentLayout,
9+
Layout
10+
},
11+
})

docs/src/.vuepress/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export default defineUserConfig({
1414
vuePluginOptions: {},
1515
}),
1616

17+
1718
/*locales: {
1819
"/": {
1920
lang: "en-US",
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<script setup lang="ts">
2+
// import ParentLayout from '@vuepress/theme-default/layouts/Layout.vue'
3+
import { Layout as ParentLayout, PageContent } from 'vuepress-theme-hope/client'
4+
import { useRoute, useRouter } from "vue-router";
5+
import { ref } from 'vue'
6+
7+
const version = ref("");
8+
9+
10+
function setVersionBasedOnCurrentPath() : void {
11+
if (route.path.startsWith('/operations/')) {
12+
const input = route.path.substring('/operations/'.length);
13+
const firstSlash = input.indexOf("/");
14+
const secondSlash = input.indexOf("/", firstSlash + 1);
15+
const result = secondSlash !== -1 ? input.slice(0, secondSlash) : input;
16+
17+
version.value = result;
18+
19+
20+
} else {
21+
version.value = "";
22+
}
23+
}
24+
25+
const route = useRoute();
26+
27+
28+
const router = useRouter();
29+
router.afterEach((_to, _from) => {
30+
setVersionBasedOnCurrentPath();
31+
});
32+
33+
setVersionBasedOnCurrentPath();
34+
35+
function navigateToNewVersion() {
36+
const input = route.path.substring('/operations/'.length);
37+
const firstSlash = input.indexOf("/");
38+
const secondSlash = input.indexOf("/", firstSlash + 1);
39+
const result = secondSlash !== -1 ? input.slice(secondSlash + 1) : "";
40+
router.push('/operations/' + version.value + "/" + result);
41+
}
42+
43+
</script>
44+
45+
<template>
46+
<ParentLayout>
47+
<template #sidebarTop>
48+
<div class="version-selector" v-if="route.path.startsWith('/operations/')">
49+
<label class="vp-sidebar-header" for="version-select">Version: </label>
50+
<select id="version-select" class="vp-sidebar-header" v-model="version" @change="navigateToNewVersion">
51+
<option value="v2/latest">next (v2.0.0-M2)</option>
52+
<option value="v1/latest">latest (v1.7.1)</option>
53+
<option value="v1/v1.7.0">v1.7.0</option>
54+
<option value="v1/v1.6.0">v1.6.0</option>
55+
<option value="v1/v1.5.2">v1.5.2</option>
56+
<option value="v1/v1.5.1">v1.5.1</option>
57+
<option value="v1/v1.5.0">v1.5.0</option>
58+
<option value="v1/v1.4.0">v1.4.0</option>
59+
<option value="v1/v1.3.2">v1.3.2</option>
60+
<option value="v1/v1.3.1">v1.3.1</option>
61+
<option value="v1/v1.3.0">v1.3.0</option>
62+
<option value="v1/v1.2.0">v1.2.0</option>
63+
<option value="v1/v1.1.0">v1.1.0</option>
64+
<option value="v1/v1.0.0">v1.0.0</option>
65+
</select></div>
66+
</template>
67+
<PageContent id="main-content" class="vp-page"/>
68+
</ParentLayout>
69+
</template>
70+
71+
<style lang="css">
72+
.version-selector {
73+
margin-top: 20px;
74+
}
75+
</style>

docs/src/.vuepress/public/.well-known/security.txt renamed to docs/src/.vuepress/public/security.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
layout: none
3+
permalink: .well-known/security.txt
4+
---
15
Contact: mailto:[email protected]
26
Expires: 2040-12-31T22:59:00.000Z
37
Preferred-Languages: de,en

0 commit comments

Comments
 (0)