valaxy-theme-yun 0.10.4 → 0.11.1
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/components/ValaxyMain.vue +11 -3
- package/components/YunAside.vue +2 -3
- package/components/YunFooter.vue +8 -8
- package/components/{YunToc.vue → YunOutline.vue} +9 -42
- package/components/YunOutlineItem.vue +48 -0
- package/components/YunOverview.vue +4 -4
- package/components/YunPostCollapse.vue +2 -2
- package/components/YunSidebarLinks.vue +3 -3
- package/components/YunWaline.vue +1 -18
- package/{layouts → composables}/404.vue +0 -0
- package/layouts/home.vue +1 -3
- package/layouts/layout.vue +0 -3
- package/package.json +4 -4
- package/styles/common/markdown.scss +1 -0
- package/styles/index.scss +3 -2
@@ -62,9 +62,9 @@ const YunTwikoo = config.value.comment.waline.enable
|
|
62
62
|
</YunCard>
|
63
63
|
</slot>
|
64
64
|
|
65
|
-
<
|
66
|
-
|
67
|
-
|
65
|
+
<slot name="main-footer-before" />
|
66
|
+
<YunFooter />
|
67
|
+
<slot name="main-footer-after" />
|
68
68
|
</div>
|
69
69
|
</slot>
|
70
70
|
|
@@ -80,6 +80,14 @@ const YunTwikoo = config.value.comment.waline.enable
|
|
80
80
|
<style lang="scss">
|
81
81
|
@use 'valaxy/client/styles/mixins' as *;
|
82
82
|
|
83
|
+
@include media('md') {
|
84
|
+
.yun-main {
|
85
|
+
&.has-sidebar {
|
86
|
+
padding-left: var(--va-sidebar-width);
|
87
|
+
}
|
88
|
+
}
|
89
|
+
}
|
90
|
+
|
83
91
|
@include media('xl') {
|
84
92
|
.content{
|
85
93
|
// 8px scrollbar width
|
package/components/YunAside.vue
CHANGED
@@ -1,10 +1,9 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
2
|
import { useI18n } from 'vue-i18n'
|
3
|
-
import {
|
3
|
+
import { useFrontmatter } from 'valaxy'
|
4
4
|
import { useAppStore } from 'valaxy/client/stores/app'
|
5
5
|
|
6
6
|
const frontmatter = useFrontmatter()
|
7
|
-
const data = useData()
|
8
7
|
const { t } = useI18n()
|
9
8
|
const app = useAppStore()
|
10
9
|
</script>
|
@@ -27,7 +26,7 @@ const app = useAppStore()
|
|
27
26
|
{{ t('sidebar.toc') }}
|
28
27
|
</h2>
|
29
28
|
|
30
|
-
<
|
29
|
+
<YunOutline v-if="frontmatter.toc !== false" />
|
31
30
|
|
32
31
|
<div class="flex-grow" />
|
33
32
|
|
package/components/YunFooter.vue
CHANGED
@@ -2,15 +2,12 @@
|
|
2
2
|
import { capitalize, computed } from 'vue'
|
3
3
|
import { useConfig } from 'valaxy'
|
4
4
|
import { useI18n } from 'vue-i18n'
|
5
|
-
|
6
5
|
import pkg from 'valaxy/package.json'
|
7
6
|
import { useThemeConfig } from '../composables'
|
8
7
|
|
9
8
|
const { t } = useI18n()
|
10
|
-
|
11
9
|
const config = useConfig()
|
12
10
|
const themeConfig = useThemeConfig()
|
13
|
-
|
14
11
|
const year = new Date().getFullYear()
|
15
12
|
|
16
13
|
const isThisYear = computed(() => {
|
@@ -18,11 +15,15 @@ const isThisYear = computed(() => {
|
|
18
15
|
})
|
19
16
|
|
20
17
|
const poweredHtml = computed(() => t('footer.powered', [`<a href="${pkg.repository}" target="_blank" rel="noopener">Valaxy</a> v${pkg.version}`]))
|
21
|
-
const footerIcon = computed(() => themeConfig.value.footer.icon
|
18
|
+
const footerIcon = computed(() => themeConfig.value.footer.icon || {
|
19
|
+
url: pkg.repository,
|
20
|
+
name: 'i-ri-cloud-line',
|
21
|
+
title: pkg.name,
|
22
|
+
})
|
22
23
|
</script>
|
23
24
|
|
24
25
|
<template>
|
25
|
-
<footer class="va-footer p-4
|
26
|
+
<footer class="va-footer p-4 text-$va-c-text-light" text="center sm">
|
26
27
|
<div v-if="themeConfig.footer.beian?.enable && themeConfig.footer.beian.icp" class="beian" m="y-2">
|
27
28
|
<a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener">
|
28
29
|
{{ themeConfig.footer.beian.icp }}
|
@@ -38,15 +39,14 @@ const footerIcon = computed(() => themeConfig.value.footer.icon!)
|
|
38
39
|
{{ year }}
|
39
40
|
</span>
|
40
41
|
|
41
|
-
<a m="x-2" class="inline-flex animate-pulse" :href="footerIcon.url" target="_blank" :title="footerIcon.title">
|
42
|
+
<a v-if="themeConfig.footer.icon" m="x-2" class="inline-flex animate-pulse" :href="footerIcon.url" target="_blank" :title="footerIcon.title">
|
42
43
|
<div :class="footerIcon.name" />
|
43
44
|
</a>
|
44
|
-
|
45
45
|
<span>{{ config.author.name }}</span>
|
46
46
|
</div>
|
47
47
|
|
48
48
|
<div v-if="themeConfig.footer.powered" class="powered" m="2">
|
49
|
-
<span v-html="poweredHtml" /> | <span>{{ t('footer.theme') }} - <a :href="themeConfig.pkg.homepage" :title="
|
49
|
+
<span v-html="poweredHtml" /> | <span>{{ t('footer.theme') }} - <a :href="themeConfig.pkg.homepage" :title="themeConfig.pkg.name" target="_blank">{{ capitalize(config.theme) }}</a> v{{ themeConfig.pkg.version }}</span>
|
50
50
|
</div>
|
51
51
|
|
52
52
|
<slot />
|
@@ -1,34 +1,19 @@
|
|
1
1
|
<script setup lang="ts">
|
2
|
-
import {
|
3
|
-
import { useI18n } from 'vue-i18n'
|
4
|
-
import type { Header } from 'valaxy'
|
2
|
+
import { ref } from 'vue'
|
5
3
|
import {
|
6
|
-
resolveHeaders,
|
7
4
|
useActiveAnchor,
|
8
|
-
|
5
|
+
useOutline,
|
9
6
|
} from 'valaxy'
|
10
7
|
import { useThemeConfig } from '../composables'
|
11
8
|
|
12
|
-
const props = defineProps<{ headers: Header[] }>()
|
13
|
-
|
14
|
-
const frontmatter = useFrontmatter()
|
15
9
|
const themeConfig = useThemeConfig()
|
16
10
|
|
17
|
-
const { locale } = useI18n()
|
18
11
|
const container = ref()
|
19
12
|
const marker = ref()
|
20
13
|
|
21
14
|
useActiveAnchor(container, marker)
|
22
15
|
|
23
|
-
const
|
24
|
-
return resolveHeaders(props.headers || [])
|
25
|
-
})
|
26
|
-
|
27
|
-
function handleClick({ target: el }: Event) {
|
28
|
-
const id = `#${(el as HTMLAnchorElement).href!.split('#')[1]}`
|
29
|
-
const heading = document.querySelector(decodeURIComponent(id)) as HTMLAnchorElement
|
30
|
-
heading?.focus()
|
31
|
-
}
|
16
|
+
const { headers, handleClick } = useOutline()
|
32
17
|
</script>
|
33
18
|
|
34
19
|
<template>
|
@@ -45,26 +30,12 @@ function handleClick({ target: el }: Event) {
|
|
45
30
|
Table of Contents for current page
|
46
31
|
</span>
|
47
32
|
|
48
|
-
<
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
:lang="lang || locale"
|
55
|
-
>
|
56
|
-
<a class="outline-link" :href="link" @click="handleClick">
|
57
|
-
{{ text }}
|
58
|
-
</a>
|
59
|
-
<ul v-if="children && frontmatter.outline === 'deep'">
|
60
|
-
<li v-for="item in children" v-show="!item.hidden" :key="item.link" :lang="lang || locale">
|
61
|
-
<a class="outline-link" p="l-3" :href="link" @click="handleClick">
|
62
|
-
{{ item.text }}
|
63
|
-
</a>
|
64
|
-
</li>
|
65
|
-
</ul>
|
66
|
-
</li>
|
67
|
-
</ul>
|
33
|
+
<YunOutlineItem
|
34
|
+
class="va-toc relative z-1"
|
35
|
+
:headers="headers"
|
36
|
+
:on-click="handleClick"
|
37
|
+
root
|
38
|
+
/>
|
68
39
|
</nav>
|
69
40
|
</div>
|
70
41
|
</div>
|
@@ -73,10 +44,6 @@ function handleClick({ target: el }: Event) {
|
|
73
44
|
<style lang="scss" scoped>
|
74
45
|
.va-toc {
|
75
46
|
text-align: left;
|
76
|
-
|
77
|
-
.va-toc-item {
|
78
|
-
color: var(--va-c-text-light);
|
79
|
-
}
|
80
47
|
}
|
81
48
|
|
82
49
|
.content {
|
@@ -0,0 +1,48 @@
|
|
1
|
+
<script setup lang="ts">
|
2
|
+
import type { MenuItem } from 'valaxy'
|
3
|
+
import { useI18n } from 'vue-i18n'
|
4
|
+
|
5
|
+
defineProps<{
|
6
|
+
headers: MenuItem[]
|
7
|
+
onClick: (e: MouseEvent) => void
|
8
|
+
root?: boolean
|
9
|
+
}>()
|
10
|
+
|
11
|
+
const { locale } = useI18n()
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<template>
|
15
|
+
<ul :class="root ? 'root' : 'nested'">
|
16
|
+
<li v-for="{ children, link, title, lang } in headers" :key="link" class="va-toc-item" :lang="lang || locale">
|
17
|
+
<a class="outline-link" :href="link" @click="onClick">{{ title }}</a>
|
18
|
+
<template v-if="children?.length">
|
19
|
+
<YunOutlineItem :headers="children" :on-click="onClick" />
|
20
|
+
</template>
|
21
|
+
</li>
|
22
|
+
</ul>
|
23
|
+
</template>
|
24
|
+
|
25
|
+
<style lang="scss" scoped>
|
26
|
+
.va-toc {
|
27
|
+
.va-toc-item {
|
28
|
+
.outline-link {
|
29
|
+
color: var(--va-c-text-light);
|
30
|
+
white-space: nowrap;
|
31
|
+
overflow: hidden;
|
32
|
+
text-overflow: ellipsis;
|
33
|
+
transition: color 0.5s;
|
34
|
+
|
35
|
+
&:hover,
|
36
|
+
&.active {
|
37
|
+
color: var(--va-c-brand);
|
38
|
+
transition: color 0.25s;
|
39
|
+
}
|
40
|
+
|
41
|
+
}
|
42
|
+
|
43
|
+
.nested {
|
44
|
+
padding-left: 0.8rem;
|
45
|
+
}
|
46
|
+
}
|
47
|
+
}
|
48
|
+
</style>
|
@@ -9,14 +9,14 @@ const router = useRouter()
|
|
9
9
|
<template>
|
10
10
|
<div class="sidebar-panel">
|
11
11
|
<div class="site-info" m="t-6">
|
12
|
-
<
|
12
|
+
<router-link class="site-author-avatar" to="/about">
|
13
13
|
<img class="rounded-full" :src="config.author.avatar" alt="avatar">
|
14
14
|
<span class="site-author-status">{{ config.author.status.emoji }}</span>
|
15
|
-
</
|
15
|
+
</router-link>
|
16
16
|
<div class="site-author-name">
|
17
|
-
<
|
17
|
+
<router-link to="/about">
|
18
18
|
{{ config.author.name }}
|
19
|
-
</
|
19
|
+
</router-link>
|
20
20
|
</div>
|
21
21
|
<router-link v-if="router.hasRoute('about-site')" to="/about/site" class="site-name">
|
22
22
|
{{ config.title }}
|
@@ -62,9 +62,9 @@ const sortedYears = computed(() => {
|
|
62
62
|
<time v-if="post.date" class="post-time" font="mono" opacity="80">{{ formatDate(post.date, 'MM-DD') }}</time>
|
63
63
|
</div>
|
64
64
|
<h2 class="post-title" font="serif black">
|
65
|
-
<
|
65
|
+
<router-link :to="post.path || ''" class="post-title-link">
|
66
66
|
{{ post.title }}
|
67
|
-
</
|
67
|
+
</router-link>
|
68
68
|
</h2>
|
69
69
|
</header>
|
70
70
|
</article>
|
@@ -5,9 +5,9 @@ const themeConfig = useThemeConfig()
|
|
5
5
|
|
6
6
|
<template>
|
7
7
|
<div class="links">
|
8
|
-
<
|
8
|
+
<AppLink v-for="item, i in themeConfig.pages" :key="i" class="link-item yun-icon-btn" :to="item.url" :title="item.name" :style="`color:${item.color}`">
|
9
9
|
<div :class="item.icon" class="icon" />
|
10
|
-
</
|
10
|
+
</AppLink>
|
11
11
|
</div>
|
12
12
|
</template>
|
13
13
|
|
@@ -21,7 +21,7 @@ const themeConfig = useThemeConfig()
|
|
21
21
|
.link-item {
|
22
22
|
display: inline-flex;
|
23
23
|
|
24
|
-
|
24
|
+
.icon {
|
25
25
|
width: 2rem;
|
26
26
|
height: 2rem;
|
27
27
|
}
|
package/components/YunWaline.vue
CHANGED
@@ -1,25 +1,8 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
2
|
import { useConfig } from 'valaxy'
|
3
|
-
import { useWaline } from 'valaxy-addon-waline'
|
4
|
-
|
5
3
|
const config = useConfig()
|
6
|
-
useWaline(config.value.comment.waline, config.value.cdn.prefix)
|
7
4
|
</script>
|
8
5
|
|
9
6
|
<template>
|
10
|
-
<
|
7
|
+
<WalineClient w="full" :server-u-r-l="config.comment.waline.serverURL" :cdn="config.cdn.prefix" />
|
11
8
|
</template>
|
12
|
-
|
13
|
-
<style lang="scss">
|
14
|
-
#waline {
|
15
|
-
--waline-theme-color: var(--va-c-primary);
|
16
|
-
--waline-active-color: var(--va-c-primary-light);
|
17
|
-
|
18
|
-
.v[data-class=v] {
|
19
|
-
.veditor {
|
20
|
-
width: calc(100% - 2em);
|
21
|
-
padding: 0.5rem;
|
22
|
-
}
|
23
|
-
}
|
24
|
-
}
|
25
|
-
</style>
|
File without changes
|
package/layouts/home.vue
CHANGED
package/layouts/layout.vue
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "valaxy-theme-yun",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.11.1",
|
4
4
|
"author": {
|
5
5
|
"email": "me@yunyoujun.cn",
|
6
6
|
"name": "YunYouJun",
|
@@ -20,10 +20,10 @@
|
|
20
20
|
"@docsearch/css": "^3.2.1",
|
21
21
|
"@docsearch/js": "^3.2.1",
|
22
22
|
"@iconify-json/ant-design": "^1.1.3",
|
23
|
-
"@iconify-json/simple-icons": "^1.1.
|
24
|
-
"valaxy-addon-waline": "0.0.
|
23
|
+
"@iconify-json/simple-icons": "^1.1.28",
|
24
|
+
"valaxy-addon-waline": "0.0.2"
|
25
25
|
},
|
26
26
|
"devDependencies": {
|
27
|
-
"valaxy": "0.
|
27
|
+
"valaxy": "0.11.1"
|
28
28
|
}
|
29
29
|
}
|
package/styles/index.scss
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
@use "./layout" as *;
|
2
|
-
|
3
2
|
@use "./common/button.scss" as *;
|
4
|
-
@use "./common/markdown.scss" as *;
|
5
3
|
|
6
4
|
@forward "star-markdown-css/src/scss/theme/yun.scss" with (
|
7
5
|
$colors: (
|
8
6
|
"primary": $c-primary,
|
9
7
|
)
|
10
8
|
);
|
9
|
+
|
10
|
+
// override the default style of star-markdown-css
|
11
|
+
@use "./common/markdown.scss" as *;
|