valaxy-theme-hairy 0.2.2 → 1.0.0
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 +13 -0
- package/components/{HairyUserPopup.vue → HairyDrawer.vue} +14 -13
- package/components/HairyFooter.vue +12 -9
- package/components/HairyHeader.vue +10 -9
- package/components/HairyImage.vue +2 -1
- package/components/HairyImageGroup.vue +12 -16
- package/components/HairyNavbar.vue +56 -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/{HairyUserTab.vue → HairyTabbar.vue} +27 -11
- 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} +1 -1
- 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} +4 -3
- 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/archive.vue +11 -0
- package/layouts/categories.vue +11 -4
- package/layouts/default.vue +8 -7
- package/layouts/home.vue +28 -18
- package/layouts/post.vue +41 -35
- package/layouts/tag.vue +8 -4
- package/layouts/tags.vue +11 -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 -16
- package/pages/archives/[year]/index.vue +20 -18
- package/pages/archives/index.vue +10 -8
- package/pages/categories/{[...categories].vue → [...its].vue} +29 -34
- package/pages/index.vue +1 -1
- package/pages/page/[page].vue +2 -2
- package/pages/tags/{[tag].vue → [tag]/index.vue} +12 -12
- package/pages/tags/index.vue +12 -5
- 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/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/archives.vue +0 -11
- 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/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,17 +1,23 @@
|
|
1
1
|
import './loading.scss'
|
2
2
|
import { ref } from 'vue'
|
3
|
-
import {
|
4
|
-
import
|
3
|
+
import type { ViteSSGContext } from 'vite-ssg'
|
4
|
+
import { createDeferred } from '@hairy/utils'
|
5
|
+
import Seto from '../styles/fonts/Seto.ttf?url'
|
5
6
|
|
6
|
-
export const
|
7
|
+
export const fontFaceDeferred = createDeferred<void>()
|
8
|
+
|
9
|
+
export function install({ router }: ViteSSGContext) {
|
7
10
|
showFullLoading()
|
11
|
+
loadFonts('Seto', Seto)
|
8
12
|
router.afterEach(() => {
|
9
|
-
|
13
|
+
fontFaceDeferred.then(hideFullLoading)
|
10
14
|
})
|
11
15
|
}
|
12
16
|
|
13
17
|
export const isLoading = ref(false)
|
14
18
|
|
19
|
+
let el: HTMLElement
|
20
|
+
|
15
21
|
function createElement() {
|
16
22
|
const loadingEl = document.createElement('div')
|
17
23
|
loadingEl.className = 'hy-loading'
|
@@ -23,8 +29,6 @@ function createElement() {
|
|
23
29
|
return loadingEl
|
24
30
|
}
|
25
31
|
|
26
|
-
let el: HTMLElement
|
27
|
-
|
28
32
|
function showFullLoading() {
|
29
33
|
if (!el)
|
30
34
|
el = createElement()
|
@@ -46,3 +50,11 @@ function hideFullLoading() {
|
|
46
50
|
el.remove()
|
47
51
|
}, 500)
|
48
52
|
}
|
53
|
+
|
54
|
+
function loadFonts(fontFamily: string, url: string) {
|
55
|
+
const font = new FontFace(fontFamily, `url(${url})`)
|
56
|
+
font.load().then(() => {
|
57
|
+
;(document.fonts as any).add(font)
|
58
|
+
fontFaceDeferred.resolve()
|
59
|
+
})
|
60
|
+
}
|
@@ -1,5 +1,6 @@
|
|
1
|
-
import type {
|
2
|
-
|
1
|
+
import type { ViteSSGContext } from 'vite-ssg'
|
2
|
+
|
3
|
+
export function install({ router }: ViteSSGContext) {
|
3
4
|
router.afterEach((to) => {
|
4
5
|
if (to.path !== '/') {
|
5
6
|
const timer = setTimeout(() => {
|
package/locales/zh-CN.yml
CHANGED
@@ -0,0 +1,139 @@
|
|
1
|
+
[
|
2
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/137081/6/32144/131304/63d630ecF4056dd1f/f65a2c5dc579d5c4.jpg",
|
3
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/112125/10/33225/345384/63d630eeF534b00c2/d95c811c46323c61.jpg",
|
4
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/177545/15/30796/140361/63d630efF51f83691/bdd4ff11552fc95a.jpg",
|
5
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/110202/16/30578/115437/63d630f1Fdcb4e8d1/83462ab45af94fe6.jpg",
|
6
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/141569/15/33680/196645/63d630c0F3d56e1cc/98ed00b92c988f22.jpg",
|
7
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/143703/38/33282/167246/63d630f3Fdfcd2642/8d208c19ece2f479.jpg",
|
8
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/203477/10/25784/173212/63d630f5Facf85677/9f6e0369dbe6a344.jpg",
|
9
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/180331/38/32597/183715/63d630c3F39552e5c/be907d046968b028.jpg",
|
10
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/94429/2/18730/350208/63d630f9Fa6a91c18/8edf277d03664a4a.jpg",
|
11
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/103018/7/34936/296122/63d630faFdf3b17f3/bdb64b8a0fc69a0a.jpg",
|
12
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/213091/31/25283/254789/63d630fbF1c7fc35e/f72df0d247f8b955.jpg",
|
13
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/136777/25/29797/249372/63d630fbFfd04bf5b/25235c83e49f09bd.jpg",
|
14
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/100025/21/21017/182015/63d630fdF8af8169a/679c35f69b4cbb6e.jpg",
|
15
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/135865/38/32964/447266/63d63101Fadabb4ae/17f984d47fba9654.jpg",
|
16
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/30624/34/20218/463869/63d63102Fad339ab8/939659289eae77cc.jpg",
|
17
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/87262/4/32298/166868/63d63104Fca7a3758/d8b56409b63f32b4.jpg",
|
18
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/177531/9/32618/276801/63d63104F712da8d4/8efbfff374052847.jpg",
|
19
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/95575/31/35028/197997/63d63108Fb2129028/a9010cd7a61ecd1a.jpg",
|
20
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/178613/15/32017/369138/63d63109F2668452f/8e97db8106def81d.jpg",
|
21
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/31147/26/19390/450033/63d63109Ff36c07c5/92e4a4d30ab91755.jpg",
|
22
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/207893/31/29907/306658/63d6310cFf925c7ae/74e246cbc5cfe7b9.jpg",
|
23
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/103502/31/35169/95092/63d63118F2f8b7277/da5cbf428a0b68ad.jpg",
|
24
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/8435/17/21121/2898762/63d6311dFc7a6234d/cdbe0f15ac6381a7.jpg",
|
25
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/178446/11/31939/348631/63d6311dF25b05f69/249cdbe88aa55c7d.jpg",
|
26
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/171459/10/33939/131747/63d63122F4225306e/68653dd4e6c3c295.jpg",
|
27
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/221336/33/22547/267537/63d6312aFa2fc2fbd/ce8258acd7177735.jpg",
|
28
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/140478/21/33124/238675/63d6312dF71c8db85/da6a8540407bba2e.jpg",
|
29
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/216738/1/21200/213086/63d6312fF6d4b59c8/80925395c7e58092.jpg",
|
30
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/115736/33/32020/361797/63d63131Fb0cd1d92/3bb9d698753905d2.jpg",
|
31
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/195283/5/32473/190475/63d63133Ff58c38fb/36ca70d73bb89fa5.jpg",
|
32
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/100124/17/35426/564887/63d6313dF6224b876/b51645eb6ac8dd24.jpg",
|
33
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/144117/25/33253/488978/63d63141F370678bf/f480d3f67017d970.jpg",
|
34
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/216316/40/22527/240219/63d63144Ff5b910ce/1227cfe3192020d1.jpg",
|
35
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/184137/24/33505/355673/63d63144F02872536/d23083b6955ed632.jpg",
|
36
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/95277/31/25860/460561/63d63146F7112a2fd/0419f98252fc6d4d.jpg",
|
37
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/214759/36/24863/304860/63d63148Fce26a282/aa280da693b6d42e.jpg",
|
38
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/102230/19/35726/196893/63d6314bF16b72c49/832529fc37d3b399.jpg",
|
39
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/101964/16/36940/475813/63d6314bFd8319028/d28b976b21bea527.jpg",
|
40
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/53889/7/22592/379046/63d63150Fbe0021f2/93eedcd0592ba3a2.jpg",
|
41
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/18622/28/20766/381866/63d63159F8c902c00/72ced9017b23803f.jpg",
|
42
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/56344/18/23409/194552/63d6315bF395b3a60/25c345816c731663.jpg",
|
43
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/192428/14/31797/388629/63d63159F0438f713/fd8a097affca1362.jpg",
|
44
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/144207/39/34001/278311/63d63165Fff7f7fe1/d288f807b8dd6dfb.jpg",
|
45
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/171327/2/34329/440391/63d63167F2500fadb/079774bd2aa13d80.jpg",
|
46
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/177053/30/32761/254046/63d6316cF351ae2ba/74500a4a8f42b1e9.jpg",
|
47
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/178782/20/31686/306533/63d6316dFc4c3ef51/4e9f3db915b95793.jpg",
|
48
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/144120/19/33118/167278/63d63171F83ce1a3c/bdf10018c4acbfa8.jpg",
|
49
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/117817/17/31499/301424/63d63174Fb6ed6ab2/88c6c5557baeaa6c.jpg",
|
50
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/124486/5/30855/226028/63d63177Fcec558c5/b53f1e6939d9c299.jpg",
|
51
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/171264/28/34368/105227/63d63178F6abfad92/edbce22640c58dd0.jpg",
|
52
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/93286/29/32310/155501/63d63186Fc8f42230/08b241071af88e15.jpg",
|
53
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/84962/28/34296/225202/63d63187Fa5353778/a2d88bb15e565f01.jpg",
|
54
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/190936/28/31626/223687/63d6318bF3252e992/f9116232f81b9d25.jpg",
|
55
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/105019/26/36982/290544/63d63194F09cf7ae8/51be1a7267fdf125.jpg",
|
56
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/102406/40/35060/377162/63d63194Ffc825c5f/92b4bac4b717d799.jpg",
|
57
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/83545/25/25395/292135/63d631a0F3ccca12f/320385579d5c09e0.jpg",
|
58
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/133544/31/33228/405867/63d631a4F4c1c44a1/cc4c97ce4895c947.jpg",
|
59
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/176244/39/33205/2130498/63d631a6Fe8b21ee6/c228158d853ff012.jpg",
|
60
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/95930/22/33237/2459672/63d631a7F8fb0cd28/62ccd010855f3731.jpg",
|
61
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/57616/23/22434/215169/63d631adFb5a9b41d/c10dcf1c803103d2.jpg",
|
62
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/106599/7/34873/2546471/63d631b0F9a0634b3/364845cf8f8b9e34.jpg",
|
63
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/47733/11/23334/440316/63d631b1Fd63a27d9/c0e3315495f670c5.jpg",
|
64
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/139076/12/33472/485700/63d631b4F9195d180/f2c91cee9240a025.jpg",
|
65
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/141997/16/32664/154238/63d631b6Fb01b05e6/9c2091edc73c294b.jpg",
|
66
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/190496/8/33263/2119880/63d631beF08e0478e/715df13eb87dcbc8.jpg",
|
67
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/108491/29/34762/247460/63d631f0Fead68c70/f6454aa7508e0afd.jpg",
|
68
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/130126/4/29287/514354/63d631f3Fa8f1b678/0fdee892fb26a36a.jpg",
|
69
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/130727/27/33953/194269/63d63203F6ef65154/72c10d061e094b27.jpg",
|
70
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/206923/24/29029/565655/63d63225F1cd44780/e81db807b90bc0d2.jpg",
|
71
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/93911/29/35130/364465/63d63228F149e502f/198e7607a0c32231.jpg",
|
72
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/194800/8/32278/454711/63d6322cFfce3080a/0866beff8c22bf52.jpg",
|
73
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/168294/14/31238/485591/63d63232F31314925/6ae966fb91b71f20.jpg",
|
74
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/48739/8/17470/384491/63d6323aF05d09be1/7211fcfc5d30a339.jpg",
|
75
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/216691/22/24962/289366/63d63241Fbe97bbbf/53f914ef966b561d.jpg",
|
76
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/158542/19/33851/516568/63d63263F9a05db04/c43657d2a9f08e11.jpg",
|
77
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/82893/24/18825/404194/63d63268F1e931037/c2b261add68f9a54.jpg",
|
78
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/91270/29/24834/163994/63d6326aF4eec1ea8/909d92b1d7359ddb.jpg",
|
79
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/48115/34/21154/367058/63d63272F158e1e77/1a90eb4a18c42bc2.jpg",
|
80
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/94232/7/35144/427062/63d6327aFe7b35ca8/9ac16f753ca72639.jpg",
|
81
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/110395/5/38088/283405/63d6327bF877df0a1/3e5b7a93f219e814.jpg",
|
82
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/81262/35/23270/169074/63d6328bFb88d86e9/809193f87b72a147.jpg",
|
83
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/40227/25/21100/315068/63d6328eF63650ded/7c17d61c88c5a3fb.jpg",
|
84
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/143835/1/33328/146757/63d63290Ff568864d/c991e63bb1ee994f.jpg",
|
85
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/137735/19/33610/445325/63d63297F8c302d0e/6abf6983b7687c9f.jpg",
|
86
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/195972/28/30513/283433/63d632a0Fa4e72fce/f2fa22ba4d90547c.jpg",
|
87
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/70008/16/21075/258632/63d632a2F3def9b47/613b33a6343bfbb1.jpg",
|
88
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/216786/26/22396/303449/63d632b6F1cfac510/6380abcdfc377862.jpg",
|
89
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/5489/1/18287/127543/63d632c8F00bcfbeb/21f3b039f7327409.jpg",
|
90
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/62522/20/23627/303501/63d63303Fd022ab51/bf1871dc802ad56e.jpg",
|
91
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/93876/26/34285/234202/63d6330cFbb000e7b/7d990e45cd5a7118.jpg",
|
92
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/138706/5/32763/336531/63d6330cFe5fb889f/59f56caaab9f26fa.jpg",
|
93
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/122681/20/29922/235612/63d63392F6c6e22c3/feccbfa0a76c6a17.jpg",
|
94
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/93827/11/24351/332690/63d63398Fa39e1ab0/d46c59c331d5f64b.jpg",
|
95
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/205600/3/29947/313889/63d6339aFf62e4fe6/d60864f5921d69b6.jpg",
|
96
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/82038/39/23532/180683/63d6339aF865113f0/aa0a70fd7c1d4683.jpg",
|
97
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/138493/27/33408/378575/63d633bcF2942da95/2a9745878385ebaf.jpg",
|
98
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/55794/11/22786/254123/63d633cbF3e4091dc/06a7adaea6df6be1.jpg",
|
99
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/9407/30/20614/185081/63d634b4Face6f1ef/2169033859883e2e.jpg",
|
100
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/161915/17/36755/2172028/63d634bbF46c3c491/f303c35b729ca87b.jpg",
|
101
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/68856/25/23176/538343/63d634bcF11333ad0/3386a9b7e8f8204e.jpg",
|
102
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/90960/13/35230/461943/63d634cdF6449d791/942a44d4bcca2b4b.jpg",
|
103
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/213694/33/25135/304380/63d634e1F77ef2a5d/ed7b9214fc42da10.jpg",
|
104
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/192437/21/32771/271782/63d634ecF0384cacc/d3fc0700bdecb2b8.jpg",
|
105
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/219981/30/22137/92097/63d634f5F00c36a1a/5f87fd976a780c47.jpg",
|
106
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/6228/20/17937/222254/63d634f6F1f2b7cf8/0c6c5e14331c972b.jpg",
|
107
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/199001/9/30289/133549/63d63500Ffd04aa07/fd16989e2c977ce8.jpg",
|
108
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/78869/20/23675/209993/63d63513F941e5f94/73240f00c335ff03.jpg",
|
109
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/6137/29/19068/288540/63d63529F834dd2ba/228dfdee4d5a53c7.jpg",
|
110
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/111440/23/35266/157289/63d63533F5207e37a/6f27a36145644098.jpg",
|
111
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/171407/25/34088/347076/63d6353bF89a117c7/f02ab4819085dc38.jpg",
|
112
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/2570/24/17450/474133/63d63541F09dacedb/72d2d74c113aba88.jpg",
|
113
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/127964/1/31838/375086/63d63549F45d6c144/a71498a8f17b686e.jpg",
|
114
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/119953/20/33856/381359/63d6354cF21c35bee/87dae7e855c48293.jpg",
|
115
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/187063/33/32480/203938/63d6354eF3ec77031/574d9b260749ac82.jpg",
|
116
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/120991/27/27778/110028/63d63558Ffd2bf474/599b3f418f1f9869.jpg",
|
117
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/148544/32/32848/222688/63d6355bF3eb37b33/324215fa4c3cd5d2.jpg",
|
118
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/129163/12/29836/535427/63d63562Fbd165c3c/bc0fecb517cac741.jpg",
|
119
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/208051/39/29158/268176/63d63563F89a06102/8993fe282edc9a11.jpg",
|
120
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/205682/8/30240/543639/63d6356cFf2e0b983/4a19d41068386a4d.jpg",
|
121
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/54416/26/22557/419996/63d63570F96081174/2dbd7f53da618f6c.jpg",
|
122
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/165473/26/28299/395435/63d6357fF10e9733b/3f403568171e0f0c.jpg",
|
123
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/172755/30/33435/675653/63d6358fF3a7b5d32/f689019ae51d8c2c.jpg",
|
124
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/109222/29/33684/195123/63d635a3Fc758c94d/835ae85b8591c542.jpg",
|
125
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/46489/39/17699/237173/63d635a2F241250f7/90c034834b3bf821.jpg",
|
126
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/91278/27/35035/411529/63d635aaF07f0526e/4ee804452969eb87.jpg",
|
127
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/54722/6/22554/223464/63d635afF9f871219/40acaed1c76b2e91.jpg",
|
128
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/168914/2/33960/167277/63d635b1F10fc7d28/2feae606d5b0f7e9.jpg",
|
129
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/223783/31/16071/155009/63d635b2Fe7cb3301/db2102e79161bc4a.jpg",
|
130
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/216201/15/22747/375519/63d635b6Fe37f101e/c5037d919d7008d4.jpg",
|
131
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/53406/33/23036/201082/63d635b9F3553bfcb/3eeb46ce2d8977ad.jpg",
|
132
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/204857/27/27754/557331/63d635e0Ff94354f4/134e47b3d340dea2.jpg",
|
133
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/6410/1/27446/264217/63d635fbF8239885a/7712375cc3a09a70.jpg",
|
134
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/119307/9/34230/318623/63d635fdF1219981c/5d8794ce077b793e.jpg",
|
135
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/114227/2/33593/313516/63d63603F0374979a/dbc7a01f85f4bfad.jpg",
|
136
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/162732/17/33827/290377/63d63657F5b0f245c/3e3c8ba89398d662.jpg",
|
137
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/24885/21/20530/309900/63d63659Ffab5dc33/6495d0c20870a202.jpg",
|
138
|
+
"https://kjimg10.360buyimg.com/ott/jfs/t1/71590/15/23888/589990/63d6365cFbd69f9de/94a60150a6e628d3.jpg"
|
139
|
+
]
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import type { ResolvedValaxyOptions, ValaxyTheme } from 'valaxy'
|
2
|
+
import type { HairyTheme, ThemeConfig } from '../../types'
|
3
|
+
import defaultImages from './default.json'
|
4
|
+
|
5
|
+
export function withImageConfig(options: ResolvedValaxyOptions<HairyTheme.Config>): ValaxyTheme<ThemeConfig> {
|
6
|
+
const prefix = '@hairy'
|
7
|
+
const postConfig = options.config.themeConfig?.post
|
8
|
+
const homeConfig = options.config.themeConfig?.home
|
9
|
+
|
10
|
+
const isEnough = (postConfig?.images?.length || 0) > 6
|
11
|
+
|
12
|
+
const postImages = isEnough ? postConfig!.images! : defaultImages
|
13
|
+
const homeImages = homeConfig?.images?.length ? homeConfig?.images : postImages
|
14
|
+
let count = 0
|
15
|
+
|
16
|
+
return {
|
17
|
+
vite: {
|
18
|
+
plugins: [
|
19
|
+
{
|
20
|
+
name: 'vite-plugin-hairy:image',
|
21
|
+
resolveId(id) {
|
22
|
+
if (id.startsWith(prefix))
|
23
|
+
return id
|
24
|
+
return null
|
25
|
+
},
|
26
|
+
load(id) {
|
27
|
+
if (id === '@hairy:images:post')
|
28
|
+
return `export default ${JSON.stringify(postImages)}`
|
29
|
+
if (id === '@hairy:images:home')
|
30
|
+
return `export default ${JSON.stringify(homeImages)}`
|
31
|
+
},
|
32
|
+
},
|
33
|
+
],
|
34
|
+
},
|
35
|
+
extendMd(ctx) {
|
36
|
+
if (ctx.route.meta.frontmatter.image)
|
37
|
+
return
|
38
|
+
ctx.route.meta.frontmatter.image = postImages[count]
|
39
|
+
|
40
|
+
if (count <= postImages.length)
|
41
|
+
count++
|
42
|
+
if (count >= postImages.length)
|
43
|
+
count = 0
|
44
|
+
},
|
45
|
+
}
|
46
|
+
}
|
package/node/index.ts
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
import type { ResolvedValaxyOptions, ValaxyTheme } from 'valaxy'
|
2
|
+
import type { ThemeConfig } from '../../types'
|
3
|
+
|
4
|
+
/**
|
5
|
+
* Default Config
|
6
|
+
*/
|
7
|
+
export const defaultThemeConfig: ThemeConfig = {
|
8
|
+
colors: {
|
9
|
+
primary: '#0078E7',
|
10
|
+
},
|
11
|
+
|
12
|
+
footer: {
|
13
|
+
since: 2022,
|
14
|
+
icon: {
|
15
|
+
name: 'i-ri-cloud-line',
|
16
|
+
animated: true,
|
17
|
+
color: 'var(--va-c-primary)',
|
18
|
+
url: 'https://sponsors.yunyoujun.cn',
|
19
|
+
title: 'Sponsor YunYouJun',
|
20
|
+
},
|
21
|
+
|
22
|
+
powered: true,
|
23
|
+
|
24
|
+
beian: {
|
25
|
+
enable: false,
|
26
|
+
icp: '',
|
27
|
+
},
|
28
|
+
},
|
29
|
+
|
30
|
+
nav: [],
|
31
|
+
}
|
32
|
+
|
33
|
+
// write a vite plugin
|
34
|
+
// https://vitejs.dev/guide/api-plugin.html
|
35
|
+
export function withThemeConfig(options: ResolvedValaxyOptions<ThemeConfig>): ValaxyTheme<ThemeConfig> {
|
36
|
+
const themeConfig = options.config.themeConfig || {}
|
37
|
+
|
38
|
+
return {
|
39
|
+
themeConfig: defaultThemeConfig,
|
40
|
+
vite: {
|
41
|
+
plugins: [
|
42
|
+
{
|
43
|
+
name: 'vite-plugin-hairy:theme',
|
44
|
+
config() {
|
45
|
+
return {
|
46
|
+
css: {
|
47
|
+
preprocessorOptions: {
|
48
|
+
scss: {
|
49
|
+
additionalData: `$c-primary: ${themeConfig.colors?.primary || '#0078E7'} !default;`,
|
50
|
+
},
|
51
|
+
},
|
52
|
+
},
|
53
|
+
|
54
|
+
valaxy: {},
|
55
|
+
}
|
56
|
+
},
|
57
|
+
},
|
58
|
+
],
|
59
|
+
},
|
60
|
+
unocss: {
|
61
|
+
safelist: generateSafelist(options.config.themeConfig as ThemeConfig),
|
62
|
+
},
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
/**
|
67
|
+
* generateSafelist by config
|
68
|
+
* @param themeConfig
|
69
|
+
*/
|
70
|
+
export function generateSafelist(themeConfig: ThemeConfig) {
|
71
|
+
const safelist: string[] = []
|
72
|
+
|
73
|
+
const footerIcon = themeConfig.footer?.icon?.name
|
74
|
+
if (footerIcon)
|
75
|
+
safelist.push(footerIcon)
|
76
|
+
|
77
|
+
return safelist
|
78
|
+
}
|
package/package.json
CHANGED
@@ -1,46 +1,40 @@
|
|
1
1
|
{
|
2
2
|
"name": "valaxy-theme-hairy",
|
3
|
-
"version": "0.
|
4
|
-
"packageManager": "pnpm@
|
3
|
+
"version": "1.0.0",
|
4
|
+
"packageManager": "pnpm@8.10.5",
|
5
5
|
"author": {
|
6
6
|
"email": "wwu710632@gmail.com",
|
7
|
-
"name": "
|
8
|
-
"url": "https://
|
7
|
+
"name": "Hairyf",
|
8
|
+
"url": "https://www.hairy.blog/"
|
9
9
|
},
|
10
|
-
"homepage": "
|
10
|
+
"homepage": "http://hairy.blog/posts/theme",
|
11
11
|
"repository": {
|
12
12
|
"type": "git",
|
13
|
-
"url": "https://github.com/
|
13
|
+
"url": "https://github.com/hairyf/valaxy-theme-hairy-next"
|
14
14
|
},
|
15
15
|
"keywords": [
|
16
16
|
"valaxy",
|
17
17
|
"theme",
|
18
|
+
"starter",
|
18
19
|
"vue"
|
19
20
|
],
|
20
|
-
"
|
21
|
+
"main": "client/index.ts",
|
22
|
+
"types": "types/index.d.ts",
|
21
23
|
"dependencies": {
|
22
|
-
"@
|
23
|
-
"@
|
24
|
-
"
|
25
|
-
"
|
26
|
-
"
|
27
|
-
"@iconify-json/fluent": "^1.1.18",
|
28
|
-
"@vueuse/core": "^8.9.4",
|
29
|
-
"@waline/client": "^2.6.1",
|
30
|
-
"animate.css": "^4.1.1",
|
31
|
-
"dayjs": "^1.11.4",
|
32
|
-
"defu": "^6.0.0",
|
33
|
-
"element-plus": "^2.2.10",
|
34
|
-
"furigana-markdown-it": "^1.0.3",
|
35
|
-
"markdown-it-attrs": "^4.1.4",
|
36
|
-
"markdown-it-bracketed-spans": "^1.0.1",
|
37
|
-
"markdown-toc": "^1.2.0",
|
38
|
-
"reading-time": "^1.5.0",
|
39
|
-
"swiper": "^8.3.1",
|
40
|
-
"unoverlay-vue": "0.2.2"
|
24
|
+
"@hairy/utils": "^0.6.8",
|
25
|
+
"@overlastic/vue": "^0.4.7",
|
26
|
+
"element-plus": "^2.7.6",
|
27
|
+
"pinia": "^2.1.7",
|
28
|
+
"swiper": "^11.0.5"
|
41
29
|
},
|
42
30
|
"devDependencies": {
|
43
|
-
"@
|
44
|
-
"@
|
31
|
+
"@iconify-json/ant-design": "^1.1.3",
|
32
|
+
"@iconify-json/fluent": "^1.1.18",
|
33
|
+
"@iconify-json/material-symbols": "^1.1.83",
|
34
|
+
"@iconify-json/simple-icons": "^1.1.19",
|
35
|
+
"valaxy": "^0.19.1",
|
36
|
+
"valaxy-addon-algolia": "^0.0.3",
|
37
|
+
"valaxy-addon-meting": "^0.1.3",
|
38
|
+
"valaxy-addon-waline": "^0.1.5"
|
45
39
|
}
|
46
40
|
}
|
@@ -2,20 +2,19 @@
|
|
2
2
|
import { ElTimeline, ElTimelineItem } from 'element-plus/es/components/timeline/index'
|
3
3
|
import 'element-plus/es/components/timeline/style/index'
|
4
4
|
import 'element-plus/es/components/timeline-item/style/index'
|
5
|
-
import { computed
|
6
|
-
import {
|
5
|
+
import { computed } from 'vue'
|
6
|
+
import { useRoute } from 'vue-router'
|
7
|
+
import { useYearArchives } from '../../../../composables'
|
7
8
|
import { getArchiveLink } from '../../../../utils'
|
8
9
|
|
9
|
-
const
|
10
|
-
|
11
|
-
month: string
|
12
|
-
}>()
|
10
|
+
const year = computed(() => useRoute().params.year as string)
|
11
|
+
const month = computed(() => useRoute().params.month as string)
|
13
12
|
|
14
13
|
const activities = useYearArchives()
|
15
14
|
const months = computed(() =>
|
16
15
|
activities.value
|
17
|
-
.filter(item => item.year ===
|
18
|
-
.filter(item => item.month ===
|
16
|
+
.filter(item => item.year === year.value)
|
17
|
+
.filter(item => item.month === month.value),
|
19
18
|
)
|
20
19
|
const count = computed(() => months.value.reduce((total, value) => total + value.count, 0))
|
21
20
|
const post = computed(() => months.value.flatMap(item => item.posts))
|
@@ -33,19 +32,19 @@ const post = computed(() => months.value.flatMap(item => item.posts))
|
|
33
32
|
{{ month }}月
|
34
33
|
</HairyBreadcrumbItem>
|
35
34
|
</HairyBreadcrumb>
|
36
|
-
<
|
37
|
-
<
|
35
|
+
<ElTimeline>
|
36
|
+
<ElTimelineItem
|
38
37
|
v-for="(item, index) in post"
|
39
38
|
:key="index"
|
40
39
|
hollow
|
41
40
|
size="large"
|
42
41
|
>
|
43
|
-
<
|
44
|
-
</
|
45
|
-
</
|
42
|
+
<HairyTimelineContent :post="item" />
|
43
|
+
</ElTimelineItem>
|
44
|
+
</ElTimeline>
|
46
45
|
</template>
|
47
46
|
|
48
47
|
<route lang="yaml">
|
49
|
-
meta:
|
50
|
-
|
51
|
-
</route>
|
48
|
+
meta:
|
49
|
+
layout: archive-month
|
50
|
+
</route>
|
@@ -4,22 +4,24 @@ import 'element-plus/es/components/timeline/style/index'
|
|
4
4
|
import 'element-plus/es/components/timeline-item/style/index'
|
5
5
|
import { computed } from 'vue'
|
6
6
|
import type { Post } from 'valaxy'
|
7
|
-
import {
|
7
|
+
import { useRoute } from 'vue-router'
|
8
8
|
import { getArchiveLink } from '../../../utils'
|
9
|
-
|
9
|
+
import { useYearArchives } from '../../../composables'
|
10
|
+
|
11
|
+
interface TimeLineByPost extends Post {
|
10
12
|
type: 'link' | 'post'
|
11
13
|
month: string
|
12
14
|
link: string
|
13
15
|
count: number
|
14
16
|
}
|
15
|
-
const props = defineProps<{
|
16
|
-
year: string
|
17
|
-
}>()
|
18
17
|
|
19
18
|
const activities = useYearArchives()
|
20
|
-
|
19
|
+
|
20
|
+
const year = computed(() => useRoute().params.year as string)
|
21
|
+
|
22
|
+
const filterYear = computed(() => activities.value.filter(item => item.year === year.value))
|
21
23
|
const timelines = computed(() => {
|
22
|
-
const timeLines: Partial<
|
24
|
+
const timeLines: Partial<TimeLineByPost>[] = []
|
23
25
|
for (const { year, count, month, posts } of filterYear.value) {
|
24
26
|
timeLines.push({
|
25
27
|
type: 'link',
|
@@ -30,7 +32,7 @@ const timelines = computed(() => {
|
|
30
32
|
for (const post of posts)
|
31
33
|
timeLines.push({ ...post, type: 'post' })
|
32
34
|
}
|
33
|
-
return timeLines as
|
35
|
+
return timeLines as TimeLineByPost[]
|
34
36
|
})
|
35
37
|
</script>
|
36
38
|
|
@@ -44,9 +46,9 @@ const timelines = computed(() => {
|
|
44
46
|
</HairyBreadcrumbItem>
|
45
47
|
</HairyBreadcrumb>
|
46
48
|
|
47
|
-
<
|
49
|
+
<ElTimeline>
|
48
50
|
<template v-for="(item, index) in timelines" :key="index">
|
49
|
-
<
|
51
|
+
<ElTimelineItem
|
50
52
|
v-if="item.type === 'link'"
|
51
53
|
hollow
|
52
54
|
:index="index"
|
@@ -55,19 +57,19 @@ const timelines = computed(() => {
|
|
55
57
|
<HairyLink @click="$router.push(getArchiveLink(year, item.month))">
|
56
58
|
{{ item.month }}月
|
57
59
|
</HairyLink>
|
58
|
-
</
|
59
|
-
<
|
60
|
+
</ElTimelineItem>
|
61
|
+
<ElTimelineItem
|
60
62
|
v-else
|
61
63
|
hollow
|
62
64
|
size="normal"
|
63
65
|
>
|
64
|
-
<
|
65
|
-
</
|
66
|
+
<HairyTimelineContent :post="item" />
|
67
|
+
</ElTimelineItem>
|
66
68
|
</template>
|
67
|
-
</
|
69
|
+
</ElTimeline>
|
68
70
|
</template>
|
69
71
|
|
70
72
|
<route lang="yaml">
|
71
|
-
meta:
|
72
|
-
|
73
|
-
</route>
|
73
|
+
meta:
|
74
|
+
layout: archive-year
|
75
|
+
</route>
|
package/pages/archives/index.vue
CHANGED
@@ -3,8 +3,10 @@ import { ElTimeline, ElTimelineItem } from 'element-plus/es/components/timeline/
|
|
3
3
|
import { usePostList } from 'valaxy'
|
4
4
|
import 'element-plus/es/components/timeline/style/index'
|
5
5
|
import 'element-plus/es/components/timeline-item/style/index'
|
6
|
-
|
6
|
+
|
7
7
|
import { getArchiveLink } from '../../utils'
|
8
|
+
import { useYearArchives } from '../../composables'
|
9
|
+
|
8
10
|
const activities = useYearArchives()
|
9
11
|
const posts = usePostList()
|
10
12
|
</script>
|
@@ -18,12 +20,12 @@ const posts = usePostList()
|
|
18
20
|
目前共计 {{ posts.length }} 篇文章
|
19
21
|
</HairyBreadcrumbItem>
|
20
22
|
</HairyBreadcrumb>
|
21
|
-
<
|
22
|
-
<
|
23
|
+
<ElTimeline>
|
24
|
+
<ElTimelineItem
|
23
25
|
v-for="(activity, index) in activities"
|
24
26
|
:key="index"
|
25
|
-
hollow
|
26
27
|
size="large"
|
28
|
+
hollow
|
27
29
|
>
|
28
30
|
<div class="activity inline-flex items-center">
|
29
31
|
<HairyLink class="text-size-8" @click="$router.push(getArchiveLink(activity.year))">
|
@@ -35,19 +37,19 @@ const posts = usePostList()
|
|
35
37
|
</HairyLink>
|
36
38
|
<span class="text-gray-5 text-size-5 ml-1">({{ activity.count }}篇)</span>
|
37
39
|
</div>
|
38
|
-
<
|
40
|
+
<HairyTimelineContent v-for="(item, index) in activity.posts.slice(0, 2)" :key="index" :post="item" />
|
39
41
|
<div v-if="activity.posts.length > 2">
|
40
42
|
<HairyLink @click="$router.push(getArchiveLink(activity.year))">
|
41
43
|
....
|
42
44
|
</HairyLink>
|
43
45
|
</div>
|
44
|
-
</
|
45
|
-
</
|
46
|
+
</ElTimelineItem>
|
47
|
+
</ElTimeline>
|
46
48
|
</template>
|
47
49
|
|
48
50
|
<route lang="yaml">
|
49
51
|
meta:
|
50
|
-
layout:
|
52
|
+
layout: archive
|
51
53
|
</route>
|
52
54
|
|
53
55
|
<style lang="scss" scoped>
|