Skip to content

Commit

Permalink
docs: 完善示例文档
Browse files Browse the repository at this point in the history
  • Loading branch information
ATQQ committed Aug 17, 2024
1 parent b4ea11d commit 5e6ebb3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 17 deletions.
31 changes: 16 additions & 15 deletions packages/theme/docs/.vitepress/blog-theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down
14 changes: 12 additions & 2 deletions packages/theme/docs/config/global.md
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}
})
```
Expand Down Expand Up @@ -1972,4 +1978,8 @@ type FormatShowDate = {
weeksAgo?: string
} | ((date: Date) => string)
```
:::
:::
![](https://cdn.upyun.sugarat.top/mdImg/sugar/1954ec12b73222a210e85b75aa48f777)
![](https://cdn.upyun.sugarat.top/mdImg/sugar/76a88adf6b81ed95b45fdb03c5ea2279)

0 comments on commit 5e6ebb3

Please sign in to comment.