valaxy-theme-hairy 0.2.2 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/client/index.ts +1 -0
- package/components/HairyBody.vue +15 -17
- package/components/HairyComment.vue +33 -0
- package/components/HairyContainer.vue +17 -0
- package/components/{HairyUserPopup.vue → HairyDrawer.vue} +16 -16
- package/components/HairyFooter.vue +12 -9
- package/components/HairyHeader.vue +10 -9
- package/components/HairyImage.vue +3 -2
- package/components/HairyImageGroup.vue +12 -16
- package/components/HairyNavbar.vue +56 -0
- package/components/HairyPageArchives.vue +59 -0
- package/components/HairyPageTags.vue +48 -0
- package/components/{HairyPostList.vue → HairyPosts.vue} +3 -3
- package/components/{HairyNavSearch.vue → HairySearch.vue} +23 -87
- package/components/{HairyUserCard.vue → HairySidebar.vue} +4 -4
- package/components/HairyTabbar.vue +56 -0
- package/components/PageTags.vue +48 -0
- package/components/ValaxyMain.vue +3 -3
- package/components/navbar/HairyNav.vue +16 -0
- package/components/navbar/HairyNavExpand.vue +12 -0
- package/components/navbar/HairyNavItem.vue +35 -0
- package/components/navbar/HairyNavbarBackground.vue +7 -0
- package/components/navbar/HairyNavbarSearch.vue +8 -0
- package/components/{HairyNavTitle.vue → navbar/HairyNavbarTitle.vue} +5 -3
- package/components/navbar/HairyNavbarToggleDark.vue +22 -0
- package/components/{HairyBreadcrumb.vue → parts/HairyBreadcrumb.vue} +2 -2
- package/components/{HairyBreadcrumbItem.vue → parts/HairyBreadcrumbItem.vue} +1 -4
- package/components/{lib/fish.js → parts/HairyFootFish.js} +5 -7
- package/components/parts/HairyFootFish.vue +38 -0
- package/components/{HairyPostTitle.vue → parts/HairyHeadHero.vue} +6 -5
- package/components/{HairyWaves.vue → parts/HairyHeadWaves.vue} +5 -5
- package/components/parts/HairyImageGlobal.vue +51 -0
- package/components/{HairyImageViewer.vue → parts/HairyImageViewer.vue} +5 -4
- package/components/parts/HairyLink.vue +21 -0
- package/components/{HairyMenu.vue → parts/HairyMenu.vue} +2 -1
- package/components/{HairyMenuItem.vue → parts/HairyMenuItem.vue} +11 -4
- package/components/parts/HairyOutline.vue +99 -0
- package/components/parts/HairyOutlineItem.vue +48 -0
- package/components/{HairySocialLinks.vue → parts/HairySocialLinks.vue} +2 -2
- package/components/{HairyTimelinePostItem.vue → parts/HairyTimelineContent.vue} +7 -8
- package/components/parts/HairyUserNav.vue +95 -0
- package/components/{article-layout → posts}/HairyArticleImage.vue +18 -19
- package/components/{article-layout → posts}/HairyArticleSeries.vue +8 -5
- package/components/{article-layout → posts}/HairyArticleText.vue +11 -4
- package/components/posts/HairyPostFooter.vue +15 -0
- package/components/{article-layout → posts}/HairyPostImageList.vue +4 -5
- package/components/{article-layout → posts}/HairyPostTextsList.vue +0 -1
- package/components/posts/HairyPostToggleLayout.vue +36 -0
- package/components/third/HairyAlgoliaSearch.vue +17 -0
- package/components/third/HairyFuseSearch.vue +10 -0
- package/components/third/HairyFuseSearchDialog.vue +32 -0
- package/components/third/HairyFuseSearchDropdown.vue +77 -0
- package/components/third/HairyFuseSearchFooter.vue +28 -0
- package/components/third/HairyFuseSearchHeader.vue +30 -0
- package/components/third/HairyFuseSearchHit.vue +52 -0
- package/components/third/HairySearchBtnDisplay.vue +29 -0
- package/components/third/HairySearchBtnInput.vue +20 -0
- package/components/third/HairySearchBtnKeys.vue +19 -0
- package/components/{HairyCarousel.vue → third/HairySwiperCarousel.vue} +6 -6
- package/{hooks/useYearArchives.ts → composables/archives.ts} +4 -3
- package/composables/category.ts +43 -0
- package/composables/config.ts +11 -0
- package/composables/dark.ts +13 -0
- package/composables/fuse.ts +60 -0
- package/composables/index.ts +8 -0
- package/composables/layout.ts +16 -0
- package/composables/outline.ts +49 -0
- package/composables/tags.ts +36 -0
- package/layouts/archive-month.vue +13 -0
- package/layouts/archive-year.vue +13 -0
- package/layouts/archives.vue +9 -9
- package/layouts/categories.vue +11 -4
- package/layouts/default.vue +9 -3
- package/layouts/home.vue +28 -18
- package/layouts/post.vue +42 -36
- package/layouts/tag.vue +8 -4
- package/layouts/tags.vue +12 -4
- package/{modules → library}/loading.ts +18 -6
- package/{modules → library}/scroll.ts +3 -2
- package/locales/zh-CN.yml +0 -2
- package/node/images/default.json +139 -0
- package/node/images/index.ts +46 -0
- package/node/index.ts +2 -0
- package/node/theme/index.ts +78 -0
- package/package.json +22 -28
- package/pages/archives/[year]/[month]/index.vue +15 -18
- package/pages/archives/[year]/index.vue +20 -20
- package/pages/archives/index.vue +1 -54
- package/pages/categories/{[...categories].vue → [...its].vue} +29 -36
- package/pages/index.vue +1 -1
- package/pages/page/[page].vue +2 -2
- package/pages/tags/[tag]/index.vue +38 -0
- package/pages/tags/index.vue +1 -36
- package/setup/main.ts +1 -1
- package/store/index.ts +1 -0
- package/store/modules/global.ts +12 -0
- package/styles/components/index.scss +4 -0
- package/styles/{markdown.scss → components/markdown.scss} +2 -1
- package/styles/components/nprogress.scss +16 -0
- package/styles/css-vars.scss +11 -0
- package/styles/element-plus/tabs.scss +1 -1
- package/styles/element-plus/timeline.scss +1 -1
- package/styles/global.scss +39 -0
- package/styles/index.scss +4 -73
- package/tsconfig.json +27 -0
- package/types/index.d.ts +163 -0
- package/unocss.config.ts +5 -1
- package/utils/index.ts +21 -39
- package/valaxy.config.ts +21 -24
- package/@types/markdown-it.d.ts +0 -1
- package/@types/markdown-toc.d.ts +0 -1
- package/@types/types.d.ts +0 -1
- package/@types/valaxy.d.ts +0 -10
- package/components/HairyAlgoliaSearchBox.vue +0 -118
- package/components/HairyBackToTop.vue +0 -72
- package/components/HairyDivider.vue +0 -0
- package/components/HairyFooterFish.vue +0 -29
- package/components/HairyLayout.vue +0 -28
- package/components/HairyLink.vue +0 -10
- package/components/HairyLinks.vue +0 -69
- package/components/HairyMeting.vue +0 -19
- package/components/HairyNav.vue +0 -42
- package/components/HairyNavBackground.vue +0 -7
- package/components/HairyNavMenu.vue +0 -11
- package/components/HairyNavToggleDark.vue +0 -16
- package/components/HairyPostToggleLayout.vue +0 -33
- package/components/HairyToc.vue +0 -135
- package/components/HairyUserNav.vue +0 -64
- package/components/HairyUserTab.vue +0 -40
- package/components/HairyWaline.vue +0 -44
- package/hooks/setupDefaultDark.ts +0 -11
- package/hooks/useCategory.ts +0 -18
- package/hooks/useCategoryPost.ts +0 -21
- package/hooks/useContext.ts +0 -13
- package/hooks/useHeaderHeight.ts +0 -9
- package/hooks/usePostLayout.ts +0 -16
- package/images.json +0 -140
- package/index.d.ts +0 -100
- package/layouts/hairy.vue +0 -36
- package/layouts/month.vue +0 -6
- package/layouts/year.vue +0 -6
- package/node/addon-hairy.ts +0 -36
- package/node/addon-images.ts +0 -61
- package/node/addon-meting.ts +0 -13
- package/node/addon-statistics.ts +0 -19
- package/node/addon-toc.ts +0 -20
- package/node/utils.ts +0 -20
- package/pages/tags/[tag].vue +0 -40
- package/utils/createContext.ts +0 -40
- package/utils/fonts.ts +0 -15
- /package/components/{HairyUserStats.vue → parts/HairyUserStats.vue} +0 -0
- /package/components/{article-layout → posts}/HairyArticleTop.vue +0 -0
- /package/{modules → library}/loading.scss +0 -0
- /package/{shims.d.ts → node/images/shims.d.ts} +0 -0
- /package/styles/{aplayer.scss → components/aplayer.scss} +0 -0
- /package/styles/{scrollbar.scss → components/scrollbar.scss} +0 -0
@@ -1,21 +1,18 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
2
|
import { ElTimeline, ElTimelineItem } from 'element-plus/es/components/timeline/index'
|
3
|
-
import '
|
4
|
-
import '
|
5
|
-
import {
|
6
|
-
import { useYearArchives } from '../../../../hooks/useYearArchives'
|
3
|
+
import { computed } from 'vue'
|
4
|
+
import { useRoute } from 'vue-router'
|
5
|
+
import { useYearArchives } from '../../../../composables'
|
7
6
|
import { getArchiveLink } from '../../../../utils'
|
8
7
|
|
9
|
-
const
|
10
|
-
|
11
|
-
month: string
|
12
|
-
}>()
|
8
|
+
const year = computed(() => useRoute().params.year as string)
|
9
|
+
const month = computed(() => useRoute().params.month as string)
|
13
10
|
|
14
11
|
const activities = useYearArchives()
|
15
12
|
const months = computed(() =>
|
16
13
|
activities.value
|
17
|
-
.filter(item => item.year ===
|
18
|
-
.filter(item => item.month ===
|
14
|
+
.filter(item => item.year === year.value)
|
15
|
+
.filter(item => item.month === month.value),
|
19
16
|
)
|
20
17
|
const count = computed(() => months.value.reduce((total, value) => total + value.count, 0))
|
21
18
|
const post = computed(() => months.value.flatMap(item => item.posts))
|
@@ -33,19 +30,19 @@ const post = computed(() => months.value.flatMap(item => item.posts))
|
|
33
30
|
{{ month }}月
|
34
31
|
</HairyBreadcrumbItem>
|
35
32
|
</HairyBreadcrumb>
|
36
|
-
<
|
37
|
-
<
|
33
|
+
<ElTimeline>
|
34
|
+
<ElTimelineItem
|
38
35
|
v-for="(item, index) in post"
|
39
36
|
:key="index"
|
40
37
|
hollow
|
41
38
|
size="large"
|
42
39
|
>
|
43
|
-
<
|
44
|
-
</
|
45
|
-
</
|
40
|
+
<HairyTimelineContent :post="item" />
|
41
|
+
</ElTimelineItem>
|
42
|
+
</ElTimeline>
|
46
43
|
</template>
|
47
44
|
|
48
45
|
<route lang="yaml">
|
49
|
-
meta:
|
50
|
-
|
51
|
-
</route>
|
46
|
+
meta:
|
47
|
+
layout: archive-month
|
48
|
+
</route>
|
@@ -1,25 +1,25 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
2
|
import { ElTimeline, ElTimelineItem } from 'element-plus/es/components/timeline/index'
|
3
|
-
import 'element-plus/es/components/timeline/style/index'
|
4
|
-
import 'element-plus/es/components/timeline-item/style/index'
|
5
3
|
import { computed } from 'vue'
|
6
4
|
import type { Post } from 'valaxy'
|
7
|
-
import {
|
5
|
+
import { useRoute } from 'vue-router'
|
8
6
|
import { getArchiveLink } from '../../../utils'
|
9
|
-
|
7
|
+
import { useYearArchives } from '../../../composables'
|
8
|
+
|
9
|
+
interface TimeLineByPost extends Post {
|
10
10
|
type: 'link' | 'post'
|
11
11
|
month: string
|
12
12
|
link: string
|
13
13
|
count: number
|
14
14
|
}
|
15
|
-
const props = defineProps<{
|
16
|
-
year: string
|
17
|
-
}>()
|
18
15
|
|
19
16
|
const activities = useYearArchives()
|
20
|
-
|
17
|
+
|
18
|
+
const year = computed(() => useRoute().params.year as string)
|
19
|
+
|
20
|
+
const filterYear = computed(() => activities.value.filter(item => item.year === year.value))
|
21
21
|
const timelines = computed(() => {
|
22
|
-
const timeLines: Partial<
|
22
|
+
const timeLines: Partial<TimeLineByPost>[] = []
|
23
23
|
for (const { year, count, month, posts } of filterYear.value) {
|
24
24
|
timeLines.push({
|
25
25
|
type: 'link',
|
@@ -30,7 +30,7 @@ const timelines = computed(() => {
|
|
30
30
|
for (const post of posts)
|
31
31
|
timeLines.push({ ...post, type: 'post' })
|
32
32
|
}
|
33
|
-
return timeLines as
|
33
|
+
return timeLines as TimeLineByPost[]
|
34
34
|
})
|
35
35
|
</script>
|
36
36
|
|
@@ -44,9 +44,9 @@ const timelines = computed(() => {
|
|
44
44
|
</HairyBreadcrumbItem>
|
45
45
|
</HairyBreadcrumb>
|
46
46
|
|
47
|
-
<
|
47
|
+
<ElTimeline>
|
48
48
|
<template v-for="(item, index) in timelines" :key="index">
|
49
|
-
<
|
49
|
+
<ElTimelineItem
|
50
50
|
v-if="item.type === 'link'"
|
51
51
|
hollow
|
52
52
|
:index="index"
|
@@ -55,19 +55,19 @@ const timelines = computed(() => {
|
|
55
55
|
<HairyLink @click="$router.push(getArchiveLink(year, item.month))">
|
56
56
|
{{ item.month }}月
|
57
57
|
</HairyLink>
|
58
|
-
</
|
59
|
-
<
|
58
|
+
</ElTimelineItem>
|
59
|
+
<ElTimelineItem
|
60
60
|
v-else
|
61
61
|
hollow
|
62
62
|
size="normal"
|
63
63
|
>
|
64
|
-
<
|
65
|
-
</
|
64
|
+
<HairyTimelineContent :post="item" />
|
65
|
+
</ElTimelineItem>
|
66
66
|
</template>
|
67
|
-
</
|
67
|
+
</ElTimeline>
|
68
68
|
</template>
|
69
69
|
|
70
70
|
<route lang="yaml">
|
71
|
-
meta:
|
72
|
-
|
73
|
-
</route>
|
71
|
+
meta:
|
72
|
+
layout: archive-year
|
73
|
+
</route>
|
package/pages/archives/index.vue
CHANGED
@@ -1,59 +1,6 @@
|
|
1
|
-
<
|
2
|
-
import { ElTimeline, ElTimelineItem } from 'element-plus/es/components/timeline/index'
|
3
|
-
import { usePostList } from 'valaxy'
|
4
|
-
import 'element-plus/es/components/timeline/style/index'
|
5
|
-
import 'element-plus/es/components/timeline-item/style/index'
|
6
|
-
import { useYearArchives } from '../../hooks/useYearArchives'
|
7
|
-
import { getArchiveLink } from '../../utils'
|
8
|
-
const activities = useYearArchives()
|
9
|
-
const posts = usePostList()
|
10
|
-
</script>
|
11
|
-
|
12
|
-
<template>
|
13
|
-
<HairyBreadcrumb class="mb-5" size="large" after="归档">
|
14
|
-
<HairyBreadcrumbItem to="/">
|
15
|
-
首页
|
16
|
-
</HairyBreadcrumbItem>
|
17
|
-
<HairyBreadcrumbItem>
|
18
|
-
目前共计 {{ posts.length }} 篇文章
|
19
|
-
</HairyBreadcrumbItem>
|
20
|
-
</HairyBreadcrumb>
|
21
|
-
<el-timeline>
|
22
|
-
<el-timeline-item
|
23
|
-
v-for="(activity, index) in activities"
|
24
|
-
:key="index"
|
25
|
-
hollow
|
26
|
-
size="large"
|
27
|
-
>
|
28
|
-
<div class="activity inline-flex items-center">
|
29
|
-
<HairyLink class="text-size-8" @click="$router.push(getArchiveLink(activity.year))">
|
30
|
-
{{ activity.year }}
|
31
|
-
</HairyLink>
|
32
|
-
<span class="text-gray-5 mx-2">/</span>
|
33
|
-
<HairyLink class="text-size-8" @click="$router.push(getArchiveLink(activity.year, activity.month))">
|
34
|
-
{{ activity.month }}
|
35
|
-
</HairyLink>
|
36
|
-
<span class="text-gray-5 text-size-5 ml-1">({{ activity.count }}篇)</span>
|
37
|
-
</div>
|
38
|
-
<HairyTimelinePostItem v-for="(item, index) in activity.posts.slice(0, 2)" :key="index" :post="item" />
|
39
|
-
<div v-if="activity.posts.length > 2">
|
40
|
-
<HairyLink @click="$router.push(getArchiveLink(activity.year))">
|
41
|
-
....
|
42
|
-
</HairyLink>
|
43
|
-
</div>
|
44
|
-
</el-timeline-item>
|
45
|
-
</el-timeline>
|
46
|
-
</template>
|
1
|
+
<template></template>
|
47
2
|
|
48
3
|
<route lang="yaml">
|
49
4
|
meta:
|
50
5
|
layout: archives
|
51
6
|
</route>
|
52
|
-
|
53
|
-
<style lang="scss" scoped>
|
54
|
-
.activity:hover {
|
55
|
-
.HairyLink {
|
56
|
-
color: var(--hy-c-primary);
|
57
|
-
}
|
58
|
-
}
|
59
|
-
</style>
|
@@ -1,39 +1,35 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
2
|
import { computed } from 'vue'
|
3
3
|
import { useI18n } from 'vue-i18n'
|
4
|
-
import { useRouter } from 'vue-router'
|
4
|
+
import { useRoute, useRouter } from 'vue-router'
|
5
5
|
import { useThemeConfig } from 'valaxy'
|
6
6
|
import { ElTimeline, ElTimelineItem } from 'element-plus/es/components/timeline/index'
|
7
|
-
import { useCurrentCategory } from '../../hooks/useCategory'
|
8
|
-
import { useCategoryPost } from '../../hooks/useCategoryPost'
|
9
7
|
|
10
8
|
import type { HairyTheme } from '../..'
|
11
|
-
import '
|
12
|
-
|
13
|
-
const
|
14
|
-
|
15
|
-
}>()
|
16
|
-
const themeConfig = useThemeConfig<HairyTheme>()
|
17
|
-
const categoriesLayout = computed(() => themeConfig.value.categories?.layout || 'post')
|
9
|
+
import { useCategory, useCategoryPost } from '../../composables'
|
10
|
+
|
11
|
+
const themeConfig = useThemeConfig<HairyTheme.Config>()
|
12
|
+
const layout = computed(() => themeConfig.value.layout?.categories || 'post')
|
18
13
|
|
19
14
|
const router = useRouter()
|
15
|
+
const route = useRoute()
|
20
16
|
|
21
|
-
const
|
22
|
-
const
|
17
|
+
const categories = computed(() => route.params.its as string)
|
18
|
+
const paths = computed(() => categories.value.split('/').filter(Boolean))
|
19
|
+
const current = useCategory(paths)
|
23
20
|
const posts = useCategoryPost(paths)
|
24
21
|
|
25
22
|
const i18n = useI18n()
|
26
23
|
|
27
|
-
|
28
|
-
|
29
|
-
const getBreadcrumbPath = (index: number) => {
|
30
|
-
const paths = props.categories.split('/').filter(Boolean)
|
24
|
+
function getBreadcrumbPath(index: number) {
|
25
|
+
const paths = categories.value.split('/').filter(Boolean)
|
31
26
|
if (paths[index] === paths[paths.length - 1])
|
32
27
|
return ''
|
33
28
|
return `/categories/${paths.slice(0, index + 1).join('/')}`
|
34
29
|
}
|
35
|
-
|
36
|
-
|
30
|
+
|
31
|
+
function displayCategory(key: string) {
|
32
|
+
router.push({ path: `/categories/${[...paths.value, key].join('/')}` })
|
37
33
|
}
|
38
34
|
</script>
|
39
35
|
|
@@ -45,7 +41,7 @@ const displayCategory = (key: string) => {
|
|
45
41
|
<HairyBreadcrumbItem :to="paths.length && '/categories/' || ''">
|
46
42
|
全部
|
47
43
|
</HairyBreadcrumbItem>
|
48
|
-
<HairyBreadcrumbItem v-for="(key, index) in categories.split(
|
44
|
+
<HairyBreadcrumbItem v-for="(key, index) in categories.split('/')" :key="key" :to="getBreadcrumbPath(index)">
|
49
45
|
{{ i18n.t(key) }}
|
50
46
|
</HairyBreadcrumbItem>
|
51
47
|
</HairyBreadcrumb>
|
@@ -53,44 +49,41 @@ const displayCategory = (key: string) => {
|
|
53
49
|
<div class="grid__view dark:text-gray-3 flex-wrap">
|
54
50
|
<template v-for="([key, item]) in current.children" :key="key">
|
55
51
|
<div
|
56
|
-
|
52
|
+
v-if="!key.startsWith('/post')"
|
53
|
+
class="relative flex items-center flex-col cursor-pointer hover:text-primary transition-colors"
|
57
54
|
@click="displayCategory(key)"
|
58
55
|
>
|
59
|
-
<div class="i-
|
56
|
+
<div class="i-material-symbols-folder-open-rounded text-22 lt-sm:text-15" />
|
60
57
|
<div class="text-center leading-normal">
|
61
58
|
{{ i18n.t(key) }}
|
62
59
|
</div>
|
63
|
-
<div class="badge">
|
64
|
-
{{ item.total }}
|
60
|
+
<div class="badge text-12px right-20px top-12px">
|
61
|
+
{{ item.total }} dir
|
65
62
|
</div>
|
66
63
|
</div>
|
67
64
|
</template>
|
68
65
|
</div>
|
69
66
|
<div class="border-t border-gray-200 dark:border-gray-500 mt-5" />
|
70
67
|
|
71
|
-
<
|
72
|
-
<
|
68
|
+
<ElTimeline v-if="layout === 'timeline'" class="pt-5 pl-10">
|
69
|
+
<ElTimelineItem v-for="(item, index) in posts" :key="index" hollow size="large">
|
73
70
|
<HairyTimelinePostItem :post="item" />
|
74
|
-
</
|
75
|
-
</
|
71
|
+
</ElTimelineItem>
|
72
|
+
</ElTimeline>
|
76
73
|
<template v-else>
|
77
|
-
<
|
74
|
+
<HairyPosts :posts="posts" />
|
78
75
|
</template>
|
79
76
|
</template>
|
80
77
|
|
81
78
|
<style lang="scss" scoped>
|
82
79
|
.badge {
|
83
80
|
position: absolute;
|
84
|
-
|
85
|
-
top:
|
86
|
-
padding-
|
87
|
-
padding-
|
88
|
-
padding-bottom: 2px;
|
89
|
-
padding-right: 6px;
|
90
|
-
|
81
|
+
// padding-left: 6px;
|
82
|
+
// padding-top: 2px;
|
83
|
+
// padding-bottom: 2px;
|
84
|
+
// padding-right: 6px;
|
91
85
|
line-height: normal;
|
92
86
|
border-radius: 50%;
|
93
|
-
background-color: #f56c6c;
|
94
87
|
color: #fff;
|
95
88
|
}
|
96
89
|
|
package/pages/index.vue
CHANGED
package/pages/page/[page].vue
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
<script setup lang="ts">
|
2
|
-
|
2
|
+
|
3
3
|
</script>
|
4
4
|
|
5
5
|
<template>
|
6
|
-
<
|
6
|
+
<HairyPosts :pagination="true" :cur-page="parseInt(String($route.params.page))" />
|
7
7
|
</template>
|
8
8
|
|
9
9
|
<route lang="yaml">
|
@@ -0,0 +1,38 @@
|
|
1
|
+
<script lang="ts" setup>
|
2
|
+
import { computed } from 'vue'
|
3
|
+
import { usePostList } from 'valaxy'
|
4
|
+
import { ElTimeline, ElTimelineItem } from 'element-plus/es/components/timeline/index'
|
5
|
+
import { useRoute } from 'vue-router'
|
6
|
+
|
7
|
+
const tag = computed(() => useRoute().params.tag)
|
8
|
+
|
9
|
+
const posts = computed<any[]>(() =>
|
10
|
+
usePostList().value.filter(post => post.tags?.includes(tag.value as string)),
|
11
|
+
)
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<template>
|
15
|
+
<HairyBreadcrumb class="mb-5" size="large" after="标签">
|
16
|
+
<HairyBreadcrumbItem to="/">
|
17
|
+
首页
|
18
|
+
</HairyBreadcrumbItem>
|
19
|
+
<HairyBreadcrumbItem>
|
20
|
+
{{ tag }}
|
21
|
+
</HairyBreadcrumbItem>
|
22
|
+
</HairyBreadcrumb>
|
23
|
+
<ElTimeline>
|
24
|
+
<ElTimelineItem
|
25
|
+
v-for="(item, index) in posts"
|
26
|
+
:key="index"
|
27
|
+
hollow
|
28
|
+
size="large"
|
29
|
+
>
|
30
|
+
<HairyTimelineContent :post="item" />
|
31
|
+
</ElTimelineItem>
|
32
|
+
</ElTimeline>
|
33
|
+
</template>
|
34
|
+
|
35
|
+
<route lang="yaml">
|
36
|
+
meta:
|
37
|
+
layout: tag
|
38
|
+
</route>
|
package/pages/tags/index.vue
CHANGED
@@ -1,41 +1,6 @@
|
|
1
|
-
<
|
2
|
-
import { useTags } from 'valaxy'
|
3
|
-
import { useRouter } from 'vue-router'
|
4
|
-
const router = useRouter()
|
5
|
-
|
6
|
-
const { tags, getTagStyle } = useTags({
|
7
|
-
primary: '#1bc9a6',
|
8
|
-
})
|
9
|
-
|
10
|
-
const displayTag = (tag: string) => {
|
11
|
-
router.push(`/tags/${tag}`)
|
12
|
-
}
|
13
|
-
</script>
|
14
|
-
|
15
|
-
<template>
|
16
|
-
<div class="inset-0 h-full flex-center flex-col">
|
17
|
-
<div text="center" class="text-size-2.5em pt-10 mb-5">
|
18
|
-
目前共计 {{ Array.from(tags).length }} 个标签
|
19
|
-
</div>
|
20
|
-
<div text="center" class="max-w-7xl flex flex-wrap justify-center items-center gap-2">
|
21
|
-
<a v-for="[key, tag] in Array.from(tags).sort()" :key="key" class="post-tag cursor-pointer" :style="getTagStyle(tag.count)" p="1" @click="displayTag(key.toString())">
|
22
|
-
{{ key }}
|
23
|
-
</a>
|
24
|
-
</div>
|
25
|
-
</div>
|
26
|
-
</template>
|
1
|
+
<template></template>
|
27
2
|
|
28
3
|
<route lang="yaml">
|
29
4
|
meta:
|
30
5
|
layout: tags
|
31
6
|
</route>
|
32
|
-
|
33
|
-
<style lang="scss" scoped>
|
34
|
-
a {
|
35
|
-
color: var(--yun-tag-color);
|
36
|
-
&:hover {
|
37
|
-
--un-text-opacity: 1;
|
38
|
-
color: var(--hy-c-primary-dark);
|
39
|
-
}
|
40
|
-
}
|
41
|
-
</style>
|
package/setup/main.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { defineAppSetup } from 'valaxy'
|
2
2
|
|
3
3
|
// import { install as installScroll } from '../modules/scroll'
|
4
|
-
import { install as installLoading } from '../
|
4
|
+
import { install as installLoading } from '../library/loading'
|
5
5
|
|
6
6
|
export default defineAppSetup((ctx) => {
|
7
7
|
// installScroll(ctx)
|
package/store/index.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export * from './modules/global'
|
@@ -1,4 +1,4 @@
|
|
1
|
-
@
|
1
|
+
@forward 'valaxy/client/styles/mixins/index.scss';
|
2
2
|
|
3
3
|
.markdown-body {
|
4
4
|
--c-toc-link: var(--hy-c-text-light);
|
@@ -67,6 +67,7 @@ html.dark {
|
|
67
67
|
.custom-block.tip {
|
68
68
|
background-color: rgba(200, 200, 200, 0.1);
|
69
69
|
border-color: var(--hy-c-primary);
|
70
|
+
padding: 0.5rem 1rem;
|
70
71
|
}
|
71
72
|
|
72
73
|
.markdown-body {
|
package/styles/css-vars.scss
CHANGED
@@ -50,6 +50,8 @@
|
|
50
50
|
--hy-c-indigo-lighter: #c9def1;
|
51
51
|
--hy-c-indigo-dark: #1d2f3f;
|
52
52
|
--hy-c-indigo-darker: #14212e;
|
53
|
+
|
54
|
+
--va-c-bg: #fafafa;
|
53
55
|
}
|
54
56
|
|
55
57
|
.dark {
|
@@ -61,8 +63,10 @@
|
|
61
63
|
--hy-c-primary-dimm-1: rgba(143, 230, 213, 0.5);
|
62
64
|
--hy-c-primary-dimm-2: rgba(143, 230, 213, 0.25);
|
63
65
|
--hy-c-primary-dimm-3: rgba(143, 230, 213, 0.05);
|
66
|
+
--va-c-bg: #1b1b1f;
|
64
67
|
}
|
65
68
|
|
69
|
+
|
66
70
|
:root {
|
67
71
|
--hy-c-waves-dimm: var(--va-c-bg);
|
68
72
|
--hy-c-waves-dimm-1: rgba(255, 255, 255, 0.7);
|
@@ -151,6 +155,13 @@
|
|
151
155
|
--hy-c-text-code: var(--hy-c-indigo-lighter);
|
152
156
|
}
|
153
157
|
|
158
|
+
:root {
|
159
|
+
--va-c-primary-light: var(--hy-c-primary-light);
|
160
|
+
--va-c-primary-lighter: var(--hy-c-primary-lighter);
|
161
|
+
--va-c-primary-dark: var(--hy-c-primary-dark);
|
162
|
+
--va-c-primary: var(--hy-c-primary);
|
163
|
+
}
|
164
|
+
|
154
165
|
/**
|
155
166
|
* element-plus Theme
|
156
167
|
* -------------------------------------------------------------------------- */
|
@@ -0,0 +1,39 @@
|
|
1
|
+
html {
|
2
|
+
color: var(--va-c-text);
|
3
|
+
}
|
4
|
+
|
5
|
+
body {
|
6
|
+
font-family: var(--hy-font-family-seto);
|
7
|
+
color: var(--va-c-text);
|
8
|
+
background-color: var(--va-c-bg);
|
9
|
+
}
|
10
|
+
|
11
|
+
html,
|
12
|
+
body {
|
13
|
+
scroll-behavior: smooth;
|
14
|
+
}
|
15
|
+
|
16
|
+
a {
|
17
|
+
color: var(--hy-c-primary);
|
18
|
+
font-weight: 500;
|
19
|
+
}
|
20
|
+
|
21
|
+
|
22
|
+
@media (min-width: 1200px) {
|
23
|
+
.breakpoint {
|
24
|
+
width: 72.5rem
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
@media (max-width: 1200px) {
|
29
|
+
.breakpoint {
|
30
|
+
padding-left: .5rem;
|
31
|
+
padding-right: .5rem
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
@media (min-width: 1600px) {
|
36
|
+
.breakpoint {
|
37
|
+
width: 75vw
|
38
|
+
}
|
39
|
+
}
|
package/styles/index.scss
CHANGED
@@ -1,73 +1,4 @@
|
|
1
|
-
@
|
2
|
-
@
|
3
|
-
@
|
4
|
-
@
|
5
|
-
@import "./aplayer.scss";
|
6
|
-
@import "animate.css";
|
7
|
-
|
8
|
-
body {
|
9
|
-
font-family: var(--hy-font-family-seto);
|
10
|
-
@apply transition-colors duration-200;
|
11
|
-
color: var(--va-c-text);
|
12
|
-
}
|
13
|
-
|
14
|
-
#app {
|
15
|
-
@apply transition-none;
|
16
|
-
min-height: 100vh;
|
17
|
-
}
|
18
|
-
|
19
|
-
a {
|
20
|
-
@apply transition-colors;
|
21
|
-
color: var(--hy-c-primary-light);
|
22
|
-
|
23
|
-
&:hover {
|
24
|
-
--un-text-opacity: 1;
|
25
|
-
color: var(--hy-c-primary-dark);
|
26
|
-
}
|
27
|
-
}
|
28
|
-
|
29
|
-
html,
|
30
|
-
body {
|
31
|
-
scroll-behavior: smooth;
|
32
|
-
}
|
33
|
-
|
34
|
-
#nprogress {
|
35
|
-
pointer-events: none;
|
36
|
-
|
37
|
-
.bar {
|
38
|
-
top: 0;
|
39
|
-
// margin-top: -5px;
|
40
|
-
height: 5px;
|
41
|
-
opacity: 0.75;
|
42
|
-
background: var(--hy-c-primary);
|
43
|
-
position: fixed;
|
44
|
-
z-index: 1031;
|
45
|
-
left: 0;
|
46
|
-
width: 100%;
|
47
|
-
border-radius: 5px;
|
48
|
-
}
|
49
|
-
}
|
50
|
-
|
51
|
-
|
52
|
-
@media (min-width: 1200px) {
|
53
|
-
.breakpoint {
|
54
|
-
width: 72.5rem;
|
55
|
-
}
|
56
|
-
}
|
57
|
-
|
58
|
-
@media (max-width: 1200px) {
|
59
|
-
.breakpoint {
|
60
|
-
padding-left: 0.5rem;
|
61
|
-
padding-right: 0.5rem;
|
62
|
-
}
|
63
|
-
}
|
64
|
-
|
65
|
-
@media (min-width: 1600px) {
|
66
|
-
.breakpoint {
|
67
|
-
width: 75vw;
|
68
|
-
}
|
69
|
-
}
|
70
|
-
|
71
|
-
body {
|
72
|
-
// background-image: linear-gradient(to top, #f7f7f7 0, #fdfdfd 20%) no-repeat bottom;
|
73
|
-
}
|
1
|
+
@use './font-face' as *;
|
2
|
+
@use './global' as *;
|
3
|
+
@use './components' as *;
|
4
|
+
@use './element-plus' as *;
|