valaxy 0.10.3 → 0.11.0
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/bin/valaxy.cjs +10 -0
- package/bin/valaxy.mjs +10 -0
- package/client/components/ValaxyMain.vue +19 -0
- package/client/composables/comments/index.ts +0 -2
- package/client/composables/layout.ts +5 -2
- package/client/composables/sidebar.ts +5 -2
- package/client/config.ts +2 -2
- package/client/utils/cdn.ts +1 -1
- package/dist/chunk-GFYAQP2J.cjs +100 -0
- package/dist/chunk-NUT63HGX.mjs +100 -0
- package/dist/{config-1d500fb4.d.ts → config-a8e39079.d.ts} +1 -1
- package/dist/node/cli.cjs +13 -0
- package/dist/node/cli.mjs +6 -6
- package/dist/node/index.cjs +1 -0
- package/dist/node/index.d.ts +5 -4
- package/dist/node/index.mjs +1 -1
- package/dist/types/{index.js → index.cjs} +0 -0
- package/dist/types/index.d.ts +1 -1
- package/package.json +37 -34
- package/types/config.ts +1 -1
- package/bin/valaxy.js +0 -11
- package/client/composables/comments/waline.ts +0 -82
- package/dist/chunk-HYU4NQYU.mjs +0 -102
- package/dist/chunk-JV7UWKCZ.js +0 -102
- package/dist/node/cli.js +0 -13
- package/dist/node/index.js +0 -1
package/bin/valaxy.cjs
ADDED
package/bin/valaxy.mjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import type { PageData, Post } from '../../types'
|
|
3
|
+
|
|
4
|
+
defineProps<{
|
|
5
|
+
frontmatter: Post
|
|
6
|
+
data?: PageData
|
|
7
|
+
}>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<main>
|
|
12
|
+
<slot name="main-content">
|
|
13
|
+
<ValaxyMd :frontmatter="frontmatter">
|
|
14
|
+
<slot name="main-content-md" />
|
|
15
|
+
<slot />
|
|
16
|
+
</ValaxyMd>
|
|
17
|
+
</slot>
|
|
18
|
+
</main>
|
|
19
|
+
</template>
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { computed } from 'vue'
|
|
2
2
|
import { useRoute } from 'vue-router'
|
|
3
3
|
|
|
4
|
-
export function useLayout(layout
|
|
4
|
+
export function useLayout(layout?: string) {
|
|
5
5
|
const route = useRoute()
|
|
6
|
-
|
|
6
|
+
if (layout)
|
|
7
|
+
return computed(() => route.meta.layout === layout)
|
|
8
|
+
else
|
|
9
|
+
return computed(() => route.meta.layout)
|
|
7
10
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Ref } from 'vue'
|
|
2
2
|
import { computed, onMounted, onUnmounted, ref } from 'vue'
|
|
3
|
-
import { useFrontmatter } from '
|
|
3
|
+
import { useFrontmatter } from './common'
|
|
4
|
+
import { useLayout } from './layout'
|
|
4
5
|
|
|
5
6
|
export function useActiveSidebarLinks(container: Ref<HTMLElement>, marker: Ref<HTMLElement>) {
|
|
6
7
|
const onScroll = throttleAndDebounce(setActiveLink, 200)
|
|
@@ -119,10 +120,12 @@ function throttleAndDebounce(fn: () => void, delay: number): () => void {
|
|
|
119
120
|
export function useSidebar() {
|
|
120
121
|
const isOpen = ref(false)
|
|
121
122
|
const fm = useFrontmatter()
|
|
123
|
+
const layout = useLayout()
|
|
122
124
|
const hasSidebar = computed(() => {
|
|
123
125
|
return (
|
|
124
126
|
fm.value.sidebar !== false
|
|
125
|
-
&&
|
|
127
|
+
&& layout.value !== 'home'
|
|
128
|
+
&& layout.value !== 'post'
|
|
126
129
|
)
|
|
127
130
|
})
|
|
128
131
|
|
package/client/config.ts
CHANGED
|
@@ -33,12 +33,12 @@ export const valaxyContextRef = shallowRef<ValaxyContext>(parse<ValaxyContext>(v
|
|
|
33
33
|
if (import.meta.hot) {
|
|
34
34
|
// /@valaxyjs/site must be static string
|
|
35
35
|
import.meta.hot.accept('/@valaxyjs/site', (m) => {
|
|
36
|
-
valaxySiteConfigRef.value = parse<ValaxySiteConfig>(m
|
|
36
|
+
valaxySiteConfigRef.value = parse<ValaxySiteConfig>(m?.default)
|
|
37
37
|
})
|
|
38
38
|
|
|
39
39
|
// context
|
|
40
40
|
import.meta.hot.accept('/@valaxyjs/context', (m) => {
|
|
41
|
-
valaxyContextRef.value = parse<ValaxyContext>(m
|
|
41
|
+
valaxyContextRef.value = parse<ValaxyContext>(m?.default)
|
|
42
42
|
})
|
|
43
43
|
}
|
|
44
44
|
|
package/client/utils/cdn.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const cdnPrefix = 'https://
|
|
1
|
+
export const cdnPrefix = 'https://unpkg.com/'
|