valaxy-theme-hairy 0.0.14 → 0.0.15
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/HairyFooter.vue +7 -2
- package/components/HairyWaline.vue +15 -0
- package/layouts/hairy.vue +11 -2
- package/layouts/post.vue +22 -0
- package/package.json +1 -1
- package/styles/index.scss +1 -0
- package/styles/markdown.scss +15 -0
@@ -21,7 +21,7 @@ const footerIcon = computed(() => themeConfig.value.footer.icon)
|
|
21
21
|
</script>
|
22
22
|
|
23
23
|
<template>
|
24
|
-
<footer v-if="themeConfig.footer" class="va-footer p-4 pb-
|
24
|
+
<footer v-if="themeConfig.footer" class="va-footer p-4 pt-5 pb-14" text="center sm" style="color:var(--va-c-text-light)">
|
25
25
|
<div v-if="themeConfig.footer.beian?.enable && themeConfig.footer.beian.icp" class="beian" m="y-2">
|
26
26
|
<a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener">
|
27
27
|
{{ themeConfig.footer.beian.icp }}
|
@@ -41,7 +41,12 @@ const footerIcon = computed(() => themeConfig.value.footer.icon)
|
|
41
41
|
<div :class="footerIcon.name" />
|
42
42
|
</a>
|
43
43
|
|
44
|
-
<span
|
44
|
+
<span>{{ config.author.name }}</span>
|
45
|
+
<span class="mx-2">|</span>
|
46
|
+
<span v-if="config.comment.waline" class="flex items-center">
|
47
|
+
<div class="i-ri-eye-fill mr-1" />
|
48
|
+
<span class="waline-pageview-count" data-path="/" />
|
49
|
+
</span>
|
45
50
|
</div>
|
46
51
|
|
47
52
|
<div v-if="themeConfig.footer.powered" class="powered" m="2">
|
@@ -6,6 +6,10 @@ const config = useConfig()
|
|
6
6
|
// 挂载 Waline
|
7
7
|
useWaline({
|
8
8
|
el: '#waline',
|
9
|
+
emoji: [
|
10
|
+
'//unpkg.com/@waline/emojis@1.0.1/weibo',
|
11
|
+
'//unpkg.com/@waline/emojis@1.0.1/bilibili',
|
12
|
+
],
|
9
13
|
...config.value.comment.waline,
|
10
14
|
})
|
11
15
|
</script>
|
@@ -26,4 +30,15 @@ useWaline({
|
|
26
30
|
padding: 4px;
|
27
31
|
width: calc(100% - 1rem - 8px);
|
28
32
|
}
|
33
|
+
.wl-emoji-popup {
|
34
|
+
border-bottom: none !important;
|
35
|
+
z-index: 1000;
|
36
|
+
}
|
37
|
+
.wl-emoji-popup .wl-tabs {
|
38
|
+
height: auto !important;
|
39
|
+
overflow-x: auto !important;
|
40
|
+
padding: 0 !important;
|
41
|
+
margin-left: -1px;
|
42
|
+
margin-right: -1px;
|
43
|
+
}
|
29
44
|
</style>
|
package/layouts/hairy.vue
CHANGED
@@ -1,11 +1,20 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
|
-
import { computed } from 'vue'
|
2
|
+
import { computed, onMounted } from 'vue'
|
3
3
|
import { useRoute } from 'vue-router'
|
4
|
+
import { pageviewCount } from '@waline/client'
|
5
|
+
import { useConfig } from 'valaxy'
|
4
6
|
|
5
7
|
const route = useRoute()
|
6
8
|
const meta = computed(() => route.meta)
|
7
9
|
const type = computed(() => meta.value.type || '')
|
8
|
-
|
10
|
+
const config = useConfig()
|
11
|
+
|
12
|
+
onMounted(() => {
|
13
|
+
pageviewCount({
|
14
|
+
serverURL: config.value.comment.waline.serverURL,
|
15
|
+
path: window.location.pathname,
|
16
|
+
})
|
17
|
+
})
|
9
18
|
</script>
|
10
19
|
|
11
20
|
<template>
|
package/layouts/post.vue
CHANGED
@@ -1,8 +1,16 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
2
|
import { useFrontmatter } from 'valaxy'
|
3
|
+
import { ElTag } from 'element-plus/es/components/tag/index'
|
4
|
+
import 'element-plus/es/components/tag/style/index'
|
3
5
|
import dayjs from 'dayjs'
|
6
|
+
import { useRouter } from 'vue-router'
|
7
|
+
const router = useRouter()
|
4
8
|
|
5
9
|
const post = useFrontmatter()
|
10
|
+
|
11
|
+
const displayTag = (tag: string) => {
|
12
|
+
router.push(`/tags/${tag}`)
|
13
|
+
}
|
6
14
|
</script>
|
7
15
|
|
8
16
|
<template>
|
@@ -16,11 +24,25 @@ const post = useFrontmatter()
|
|
16
24
|
<span>本文字数 {{ (post.length / 1000).toFixed(1) }}k 字</span>
|
17
25
|
<span>阅读时长 {{ post.durations.minutes.toFixed(2) }} 分钟</span>
|
18
26
|
</div>
|
27
|
+
<div v-if="post.tags?.length" class="tags flex-center gap-2 mt-2">
|
28
|
+
<el-tag v-for="(tag) in post.tags" :key="tag" class="dark:bg-dark-50 cursor-pointer" @click="displayTag(tag)">
|
29
|
+
{{ tag }}
|
30
|
+
</el-tag>
|
31
|
+
</div>
|
19
32
|
</template>
|
20
33
|
<router-view />
|
34
|
+
<div class="mb-15">
|
35
|
+
<div class="border-t border-gray-200 dark:border-gray-600"></div>
|
36
|
+
<div class="flex items-center justify-end mt-2">
|
37
|
+
<div class="i-ri-eye-fill mr-2" />
|
38
|
+
阅读次数 <span class="waline-pageview-count mx-2" /> 次
|
39
|
+
</div>
|
40
|
+
</div>
|
21
41
|
<template #body-slide>
|
22
42
|
<HairyUserTab />
|
23
43
|
</template>
|
24
44
|
</HairyLayout>
|
25
45
|
</template>
|
26
46
|
|
47
|
+
<style lang="scss">
|
48
|
+
</style>
|
package/package.json
CHANGED
package/styles/index.scss
CHANGED
package/styles/markdown.scss
CHANGED
@@ -57,4 +57,19 @@ html.dark {
|
|
57
57
|
.custom-block.tip {
|
58
58
|
background-color: rgba(200, 200, 200, 0.1);
|
59
59
|
border-color: var(--hy-c-primary);
|
60
|
+
}
|
61
|
+
|
62
|
+
.markdown-body {
|
63
|
+
--un-prose-borders: var(--hy-c-primary);
|
64
|
+
}
|
65
|
+
|
66
|
+
.prose :where(blockquote):not(:where(.not-prose, .not-prose *)) {
|
67
|
+
background: rgba(200, 200, 200, 0.1);
|
68
|
+
@apply py-1px;
|
69
|
+
|
70
|
+
font-size: 15px;
|
71
|
+
|
72
|
+
>p {
|
73
|
+
margin: 0.5rem 0;
|
74
|
+
}
|
60
75
|
}
|