From 5e6ebb3ae5191a68d899cf4f0fd14b2f73b9ce59 Mon Sep 17 00:00:00 2001 From: sugar Date: Sat, 17 Aug 2024 20:31:24 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E5=AE=8C=E5=96=84=E7=A4=BA=E4=BE=8B?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/theme/docs/.vitepress/blog-theme.ts | 31 ++++++++++---------- packages/theme/docs/config/global.md | 14 +++++++-- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/packages/theme/docs/.vitepress/blog-theme.ts b/packages/theme/docs/.vitepress/blog-theme.ts index 69031c10..24c991e2 100644 --- a/packages/theme/docs/.vitepress/blog-theme.ts +++ b/packages/theme/docs/.vitepress/blog-theme.ts @@ -12,21 +12,22 @@ const RSS: Theme.RSSOptions = { } export const blogTheme = getThemeConfig({ - article: { - analyzeTitles: { - inlineWordCount: '{{value}} word counts', - inlineReadTime: '{{value}} min read time', - wordCount: 'Total word count', - readTime: 'Total read time', - author: 'Author', - publishDate: 'Published on', - lastUpdated: 'Last updated on', - tag: 'Tags', - } - }, - formatShowDate(date) { - return new Date(date).toLocaleTimeString() - }, + // article: { + // analyzeTitles: { + // inlineWordCount: '{{value}} word counts', + // inlineReadTime: '{{value}} min read time', + // wordCount: 'Total word count', + // readTime: 'Total read time', + // author: 'Author', + // publishDate: 'Published on', + // lastUpdated: 'Last updated on', + // tag: 'Tags', + // } + // }, + // formatShowDate: { + // justNow: '不久前', + // minutesAgo: ' minutes ago', + // }, search: { pageResultCount: 5 }, diff --git a/packages/theme/docs/config/global.md b/packages/theme/docs/config/global.md index a3f119c9..771525c2 100644 --- a/packages/theme/docs/config/global.md +++ b/packages/theme/docs/config/global.md @@ -1939,7 +1939,13 @@ interface ImageStyleConfig { ```ts [example] const blogTheme = getThemeConfig({ formatShowDate(date) { - return new Date(date).toLocaleTimeString() + return new Date(date).toLocaleString() + } +}) + +const blogTheme = getThemeConfig({ + formatShowDate: { + minutesAgo: ' minutes ago', } }) ``` @@ -1972,4 +1978,8 @@ type FormatShowDate = { weeksAgo?: string } | ((date: Date) => string) ``` -::: \ No newline at end of file +::: + +![](https://cdn.upyun.sugarat.top/mdImg/sugar/1954ec12b73222a210e85b75aa48f777) + +![](https://cdn.upyun.sugarat.top/mdImg/sugar/76a88adf6b81ed95b45fdb03c5ea2279) \ No newline at end of file