valaxy-theme-hairy 1.0.0 → 1.0.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.
@@ -2,6 +2,10 @@
2
2
  import { onMounted } from 'vue'
3
3
  import { setupDefaultDark } from '../composables'
4
4
 
5
+ import 'element-plus/theme-chalk/base.css'
6
+ import 'element-plus/theme-chalk/el-timeline.css'
7
+ import 'element-plus/theme-chalk/el-timeline-item.css'
8
+
5
9
  onMounted(setupDefaultDark)
6
10
  </script>
7
11
 
@@ -1,5 +1,5 @@
1
1
  <script lang="ts" setup>
2
- import 'element-plus/es/components/drawer/style/index'
2
+ import 'element-plus/theme-chalk/el-dialog.css'
3
3
  import { ElDrawer } from 'element-plus/es/components/drawer/index'
4
4
  import { useRoute } from 'vue-router'
5
5
  import { watch } from 'vue'
@@ -24,11 +24,10 @@ watch(() => route.fullPath, () => showDrawer.value = false)
24
24
 
25
25
  <style lang="scss">
26
26
  .el-drawer {
27
+ background-color: transparent;
27
28
  .el-drawer__header {
28
29
  display: none;
29
30
  }
30
-
31
- background-color: transparent;
32
31
  .el-icon.el-drawer__close {
33
32
  font-size: 24px;
34
33
  }
@@ -1,6 +1,6 @@
1
1
  <script lang="ts" setup>
2
2
  import { ElImage, imageProps } from 'element-plus/es/components/image/index'
3
- import 'element-plus/es/components/image/style/index'
3
+ import 'element-plus/theme-chalk/el-image.css'
4
4
  import { inject } from 'vue'
5
5
 
6
6
  const props = defineProps(imageProps)
@@ -0,0 +1,59 @@
1
+ <script lang="ts" setup>
2
+ import { ElTimeline, ElTimelineItem } from 'element-plus/es/components/timeline/index'
3
+ import { usePostList } from 'valaxy'
4
+
5
+ import { getArchiveLink } from '../utils'
6
+ import { useYearArchives } from '../composables'
7
+
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
+ <ElTimeline>
22
+ <ElTimelineItem
23
+ v-for="(activity, index) in activities"
24
+ :key="index"
25
+ size="large"
26
+ hollow
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
+ <HairyTimelineContent 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
+ </ElTimelineItem>
45
+ </ElTimeline>
46
+ </template>
47
+
48
+ <route lang="yaml">
49
+ meta:
50
+ layout: archive
51
+ </route>
52
+
53
+ <style lang="scss" scoped>
54
+ .activity:hover {
55
+ .HairyLink {
56
+ color: var(--hy-c-primary);
57
+ }
58
+ }
59
+ </style>
@@ -0,0 +1,48 @@
1
+ <script lang="ts" setup>
2
+ import { useRouter } from 'vue-router'
3
+ import { useHairyTags } from '../composables'
4
+
5
+ const router = useRouter()
6
+
7
+ const { getTagStyle, tags } = useHairyTags({
8
+ primary: '#1bc9a6',
9
+ })
10
+
11
+ function displayTag(tag: string) {
12
+ router.push(`/tags/${tag}`)
13
+ }
14
+ </script>
15
+
16
+ <template>
17
+ <div class="min-h-59vh flex-center flex-col">
18
+ <div text="center" class="text-size-2.5em pt-10 mb-5">
19
+ 目前共计 {{ Array.from(tags).length }} 个标签
20
+ </div>
21
+ <div text="center" class="max-w-7xl flex flex-wrap justify-center items-center gap-2">
22
+ <a
23
+ v-for="[key, tag] in Array.from(tags).sort()"
24
+ :key="key" class="post-tag cursor-pointer"
25
+ :style="getTagStyle(tag.count)"
26
+ p="1"
27
+ @click="displayTag(key.toString())"
28
+ >
29
+ {{ key }}
30
+ </a>
31
+ </div>
32
+ </div>
33
+ </template>
34
+
35
+ <route lang="yaml">
36
+ meta:
37
+ layout: tags
38
+ </route>
39
+
40
+ <style lang="scss" scoped>
41
+ a {
42
+ color: var(--yun-tag-color);
43
+ &:hover {
44
+ --un-text-opacity: 1;
45
+ color: var(--hy-c-primary-dark);
46
+ }
47
+ }
48
+ </style>
@@ -1,7 +1,7 @@
1
1
  <script lang="ts" setup>
2
2
  import { ElTabPane, ElTabs } from 'element-plus/es/components/tabs/index'
3
- import 'element-plus/es/components/tabs/style/index'
4
- import 'element-plus/es/components/tab-pane/style/index'
3
+ import 'element-plus/theme-chalk/el-tabs.css'
4
+ import 'element-plus/theme-chalk/el-tab-pane.css'
5
5
  import { computed, provide, ref } from 'vue'
6
6
 
7
7
  import type { DefaultTheme } from 'valaxy/types'
@@ -1,6 +1,6 @@
1
1
  <script lang="ts" setup>
2
2
  import { ElBreadcrumb, breadcrumbProps } from 'element-plus/es/components/breadcrumb/index'
3
- import 'element-plus/es/components/breadcrumb/style/index'
3
+ import 'element-plus/theme-chalk/el-breadcrumb.css'
4
4
  import type { PropType } from 'vue'
5
5
  import { computed } from 'vue'
6
6
 
@@ -1,7 +1,7 @@
1
1
  <script lang="ts" setup>
2
2
  import { usePrograms } from '@overlastic/vue'
3
3
  import { ElImageViewer, imageViewerProps } from 'element-plus/es/components/image-viewer/index'
4
- import 'element-plus/es/components/image-viewer/style/index'
4
+ import 'element-plus/theme-chalk/el-image-viewer.css'
5
5
  import { onMounted, onUnmounted } from 'vue'
6
6
 
7
7
  const props = defineProps(imageViewerProps)
@@ -59,13 +59,13 @@ async function navigation(path: string) {
59
59
  padding: 2px;
60
60
  width: 100%;
61
61
  border: 1px solid transparent;
62
- > div {
63
- justify-content: center;
64
- }
65
62
  border-radius: 10px;
66
63
  transition: all 0.2s;
67
64
  background-color: transparent;
68
65
  user-select: none;
66
+ > div {
67
+ justify-content: center;
68
+ }
69
69
  }
70
70
 
71
71
  .HairyMenuItem:hover,
@@ -3,7 +3,7 @@
3
3
  <HairyNavbar />
4
4
  <HairyHeader />
5
5
  <HairyBody>
6
- <router-view />
6
+ <HairyPageArchives />
7
7
  </HairyBody>
8
8
  <HairyFooter />
9
9
  <HairyDrawer />
@@ -1,3 +1,6 @@
1
+ <script lang="ts" setup>
2
+ </script>
3
+
1
4
  <template>
2
5
  <HairyContainer>
3
6
  <HairyNavbar />
@@ -8,3 +11,5 @@
8
11
  <HairyFooter />
9
12
  </HairyContainer>
10
13
  </template>
14
+
15
+
package/layouts/post.vue CHANGED
@@ -3,7 +3,7 @@ import { dayjs } from 'element-plus'
3
3
  import { useFrontmatter } from 'valaxy'
4
4
  import { useRouter } from 'vue-router'
5
5
  import { ElTag } from 'element-plus/es/components/tag/index'
6
- import 'element-plus/es/components/tag/style/index'
6
+ import 'element-plus/theme-chalk/el-tag.css'
7
7
 
8
8
  defineProps<{
9
9
  header?: {
package/layouts/tags.vue CHANGED
@@ -1,4 +1,5 @@
1
1
  <script lang="ts" setup>
2
+ console.log('---')
2
3
  </script>
3
4
 
4
5
  <template>
@@ -6,7 +7,7 @@
6
7
  <HairyNavbar />
7
8
  <HairyHeader title="所有标签" />
8
9
  <HairyBody>
9
- <router-view />
10
+ <HairyPageTags />
10
11
  </HairyBody>
11
12
  <HairyFooter />
12
13
  </HairyContainer>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valaxy-theme-hairy",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "packageManager": "pnpm@8.10.5",
5
5
  "author": {
6
6
  "email": "wwu710632@gmail.com",
@@ -1,7 +1,5 @@
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 { useRoute } from 'vue-router'
7
5
  import { useYearArchives } from '../../../../composables'
@@ -1,7 +1,5 @@
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
5
  import { useRoute } from 'vue-router'
@@ -1,61 +1,6 @@
1
- <script lang="ts" setup>
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
-
7
- import { getArchiveLink } from '../../utils'
8
- import { useYearArchives } from '../../composables'
9
-
10
- const activities = useYearArchives()
11
- const posts = usePostList()
12
- </script>
13
-
14
- <template>
15
- <HairyBreadcrumb class="mb-5" size="large" after="归档">
16
- <HairyBreadcrumbItem to="/">
17
- 首页
18
- </HairyBreadcrumbItem>
19
- <HairyBreadcrumbItem>
20
- 目前共计 {{ posts.length }} 篇文章
21
- </HairyBreadcrumbItem>
22
- </HairyBreadcrumb>
23
- <ElTimeline>
24
- <ElTimelineItem
25
- v-for="(activity, index) in activities"
26
- :key="index"
27
- size="large"
28
- hollow
29
- >
30
- <div class="activity inline-flex items-center">
31
- <HairyLink class="text-size-8" @click="$router.push(getArchiveLink(activity.year))">
32
- {{ activity.year }}
33
- </HairyLink>
34
- <span class="text-gray-5 mx-2">/</span>
35
- <HairyLink class="text-size-8" @click="$router.push(getArchiveLink(activity.year, activity.month))">
36
- {{ activity.month }}
37
- </HairyLink>
38
- <span class="text-gray-5 text-size-5 ml-1">({{ activity.count }}篇)</span>
39
- </div>
40
- <HairyTimelineContent v-for="(item, index) in activity.posts.slice(0, 2)" :key="index" :post="item" />
41
- <div v-if="activity.posts.length > 2">
42
- <HairyLink @click="$router.push(getArchiveLink(activity.year))">
43
- ....
44
- </HairyLink>
45
- </div>
46
- </ElTimelineItem>
47
- </ElTimeline>
48
- </template>
1
+ <template></template>
49
2
 
50
3
  <route lang="yaml">
51
4
  meta:
52
- layout: archive
5
+ layout: archives
53
6
  </route>
54
-
55
- <style lang="scss" scoped>
56
- .activity:hover {
57
- .HairyLink {
58
- color: var(--hy-c-primary);
59
- }
60
- }
61
- </style>
@@ -6,8 +6,6 @@ import { useThemeConfig } from 'valaxy'
6
6
  import { ElTimeline, ElTimelineItem } from 'element-plus/es/components/timeline/index'
7
7
 
8
8
  import type { HairyTheme } from '../..'
9
- import 'element-plus/es/components/timeline/style/index'
10
- import 'element-plus/es/components/timeline-item/style/index'
11
9
  import { useCategory, useCategoryPost } from '../../composables'
12
10
 
13
11
  const themeConfig = useThemeConfig<HairyTheme.Config>()
@@ -2,8 +2,6 @@
2
2
  import { computed } from 'vue'
3
3
  import { usePostList } from 'valaxy'
4
4
  import { ElTimeline, ElTimelineItem } from 'element-plus/es/components/timeline/index'
5
- import 'element-plus/es/components/timeline/style/index'
6
- import 'element-plus/es/components/timeline-item/style/index'
7
5
  import { useRoute } from 'vue-router'
8
6
 
9
7
  const tag = computed(() => useRoute().params.tag)
@@ -1,48 +1,6 @@
1
- <script lang="ts" setup>
2
- import { useRouter } from 'vue-router'
3
- import { useHairyTags } from '../../composables'
4
-
5
- const router = useRouter()
6
-
7
- const { getTagStyle, tags } = useHairyTags({
8
- primary: '#1bc9a6',
9
- })
10
-
11
- function displayTag(tag: string) {
12
- router.push(`/tags/${tag}`)
13
- }
14
- </script>
15
-
16
- <template>
17
- <div class="min-h-59vh flex-center flex-col">
18
- <div text="center" class="text-size-2.5em pt-10 mb-5">
19
- 目前共计 {{ Array.from(tags).length }} 个标签
20
- </div>
21
- <div text="center" class="max-w-7xl flex flex-wrap justify-center items-center gap-2">
22
- <a
23
- v-for="[key, tag] in Array.from(tags).sort()"
24
- :key="key" class="post-tag cursor-pointer"
25
- :style="getTagStyle(tag.count)"
26
- p="1"
27
- @click="displayTag(key.toString())"
28
- >
29
- {{ key }}
30
- </a>
31
- </div>
32
- </div>
33
- </template>
1
+ <template></template>
34
2
 
35
3
  <route lang="yaml">
36
4
  meta:
37
5
  layout: tags
38
6
  </route>
39
-
40
- <style lang="scss" scoped>
41
- a {
42
- color: var(--yun-tag-color);
43
- &:hover {
44
- --un-text-opacity: 1;
45
- color: var(--hy-c-primary-dark);
46
- }
47
- }
48
- </style>