diff --git a/docs/.vitepress/config/sidebar.ts b/docs/.vitepress/config/sidebar.ts index c5f8b6e55..d1273c269 100644 --- a/docs/.vitepress/config/sidebar.ts +++ b/docs/.vitepress/config/sidebar.ts @@ -1,6 +1,7 @@ import type { DefaultTheme } from 'vitepress'; import { sync } from 'fast-glob'; import * as matter from 'gray-matter'; +import { getChineseZodiac, getChineseZodiacAlias } from '../theme/utils.ts'; export const sidebar: DefaultTheme.Config['sidebar'] = { '/categories/issues/': getItemsByDate("categories/issues"), @@ -75,7 +76,8 @@ function getItemsByDate (path: string) { // 添加年份分组 yearGroups.unshift({ - text: `${year}年 (${articleItems.length}篇)`, + text: `生肖 + ${year}年 (${articleItems.length}篇)`, items: articleItems, collapsed: true, }); @@ -84,7 +86,8 @@ function getItemsByDate (path: string) { if (topArticleItems.length > 0) { // 添加置顶分组 yearGroups.unshift({ - text: `📑 我的置顶 (${topArticleItems.length}篇)`, + text: ` + 我的置顶 (${topArticleItems.length}篇)`, items: topArticleItems, collapsed: false, }); @@ -166,7 +169,16 @@ function addOrderNumber(groups) { for (let i = 0; i < groups.length; i++) { for (let j = 0; j < groups[i].items.length; j++) { const items = groups[i].items; - items[j].text = `[${j + 1}] ${items[j].text}`; + const index = j + 1; + let indexStyle = `
${index}
`; + if (index == 1) { + indexStyle = `
${index}
`; + } else if (index == 2) { + indexStyle = `
${index}
`; + } else if (index == 3) { + indexStyle = `
${index}
`; + } + items[j].text = `${indexStyle}${items[j].text}`; } } } \ No newline at end of file diff --git a/docs/.vitepress/theme/components/Archive.vue b/docs/.vitepress/theme/components/Archive.vue index 36addb9e2..6ecde0fa3 100644 --- a/docs/.vitepress/theme/components/Archive.vue +++ b/docs/.vitepress/theme/components/Archive.vue @@ -9,7 +9,7 @@ @close="goToLink('/archives')" > {{ $category }} (共 {{ $articleData.length }} 篇) @@ -20,7 +20,7 @@ @close="goToLink('/archives')" > {{ $tag }} (共 {{ $articleData.length }} 篇) @@ -31,7 +31,7 @@ @close="goToLink('/archives')" > {{ $year }}年 (共 {{ $articleData.length }} 篇) @@ -40,7 +40,7 @@ class="content" > 共 {{ articleData.length }} 篇,未完待续······ @@ -79,7 +79,7 @@