@ampernic/vitepress-theme-alt-docs 0.1.3 → 0.1.4
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.
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { onKeyStroke } from '@vueuse/core'
|
|
3
|
-
import { useRoute } from 'vitepress'
|
|
3
|
+
import { useData, useRoute } from 'vitepress'
|
|
4
4
|
import { computed, defineAsyncComponent, ref } from 'vue'
|
|
5
5
|
|
|
6
6
|
const ADSearch = defineAsyncComponent(() => import('./ADSearch.vue'))
|
|
7
7
|
|
|
8
|
+
const { site } = useData()
|
|
8
9
|
const route = useRoute()
|
|
9
10
|
const open = ref(false)
|
|
10
11
|
|
|
12
|
+
// Strip base prefix from route.path before testing
|
|
13
|
+
// (route.path includes base, e.g. /alt-domain/11.1/... when base=/alt-domain/)
|
|
14
|
+
const contentPath = computed(() => {
|
|
15
|
+
const base = site.value.base
|
|
16
|
+
const path = route.path
|
|
17
|
+
return base.length > 1 && path.startsWith(base) ? path.slice(base.length - 1) : path
|
|
18
|
+
})
|
|
19
|
+
|
|
11
20
|
// Show search on all versioned pages (including version root /11.1/)
|
|
12
21
|
// Hidden only on site root and distro-selection landing pages
|
|
13
22
|
const isContentPage = computed(() =>
|
|
14
|
-
/^\/\d+\.\d+(?:-\w+)?\//.test(
|
|
23
|
+
/^\/\d+\.\d+(?:-\w+)?\//.test(contentPath.value)
|
|
15
24
|
)
|
|
16
25
|
|
|
17
26
|
function openSearch() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ampernic/vitepress-theme-alt-docs",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Shared VitePress theme for ALT Linux documentation",
|
|
5
5
|
"license": "GPL-3.0-or-later",
|
|
6
6
|
"author": "Ampernic",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"@nolebase/vitepress-plugin-enhanced-readabilities": "^2.14.0",
|
|
34
34
|
"markdown-it-kbd": "^1.0.0",
|
|
35
35
|
"vitepress-plugin-tabs": "^0.6.0",
|
|
36
|
-
"@ampernic/vitepress-plugin-pagefind": "0.1.2",
|
|
37
36
|
"@ampernic/vitepress-plugin-alt-docs-versioning": "0.1.2",
|
|
37
|
+
"@ampernic/vitepress-plugin-html-image": "0.1.2",
|
|
38
38
|
"@ampernic/vitepress-plugin-cross-site-router": "0.1.2",
|
|
39
|
-
"@ampernic/vitepress-plugin-
|
|
39
|
+
"@ampernic/vitepress-plugin-pagefind": "0.1.2"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"builtin-modules": "^3.3.0",
|