Skip to content

Commit ac55b3a

Browse files
committed
重命名组件,指定日期格式
1 parent 2e75d2b commit ac55b3a

File tree

9 files changed

+43
-50
lines changed

9 files changed

+43
-50
lines changed

packages/pure/components/pages/Copyright.astro

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ const showToastStr = showToast.toString()
9191
<span>Published at</span>
9292
<span class='text-sm text-foreground'>
9393
{getFormattedDate(publishDate, {
94-
month: 'long'
94+
year: 'numeric',
95+
month: '2-digit',
96+
day: '2-digit'
9597
})}
9698
</span>
9799
</div>
@@ -126,7 +128,9 @@ const showToastStr = showToast.toString()
126128
<span>Published at</span>
127129
<span class='text-sm text-foreground'>
128130
{getFormattedDate(publishDate, {
129-
month: 'long'
131+
year: 'numeric',
132+
month: '2-digit',
133+
day: '2-digit'
130134
})}
131135
</span>
132136
</div>

packages/pure/components/pages/Hero.astro

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ const {
2626
} = Astro.props
2727
2828
const dateTimeOptions: Intl.DateTimeFormatOptions = {
29-
month: 'short'
29+
year: 'numeric',
30+
month: '2-digit',
31+
day: '2-digit'
3032
}
3133
---
3234

packages/pure/components/pages/PostPreview.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const postDate = data.updatedDate ?? data.publishDate
5151
)
5252
}
5353

54-
<FormattedDate class='min-w-[95px] py-1 text-xs' date={postDate} />
54+
<FormattedDate class='min-w-[95px] py-1 text-xs' date={postDate} dateTimeOptions={{ year: 'numeric', month: '2-digit', day: '2-digit' }} />
5555

5656
<Tag class='z-10 flex-grow'>
5757
{/* title */}

public/styles/global.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ body.hide-scrollbar::-webkit-scrollbar {
1515
body {
1616
font-family: "JyunsaiKaai";
1717
font-weight: normal;
18+
text-autospace: normal;
1819
}
1920

2021
@font-face {

src/content/blog/test/conversation-test.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
title: 'Conversation Component Feature Test'
2+
title: '组件指南: Conversation Component'
33
publishDate: 2025-09-15
44
description: 'Testing new features: optional collapse, distinct card designs, and improved numbering.'
55
tags:
66
- test
7-
- astro
7+
- component
88
- 建站
99
language: 'english'
10-
slug: conversation-component-test
10+
slug: ccte
1111
---
1212

1313
import { Conversation,Message } from '@/components/conversation';
Lines changed: 24 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
---
2-
title: Banner 组件用法
3-
description: '如何使用通用的 Banner 组件来创建页面标题区域'
2+
title: '组件指南: Banner'
3+
description: '如何使用通用的 Banner 组件来创建页面标题区域'
44
publishDate: 2025-10-17 19:45:00
55
slug: yex1
6-
tags: ['组件', '建站']
6+
tags: ['component', '建站']
77
---
88

99
import { MdxRepl, Aside } from '@/custom/components/user';
1010
import Banner from '@/components/banner/Banner.astro';
1111
import { Icon } from '@/custom/components/user';
1212
import bannerImage from '@/assets/shelf/desk1.png';
1313

14-
`Banner` 是一个通用的页面横幅组件,用于快速创建一个包含左侧内容和右侧图片的标题区域。它通过 Astro 的 `slot` (插槽) 特性提供了极高的灵活性。
14+
`Banner` 是一个通用的页面横幅组件,用于快速创建一个包含左侧内容和右侧图片的标题区域.
15+
16+
`Banner` 组件的核心是它的默认插槽. 您可以在组件标签内放置任何有效的 HTML 或 Astro 组件,它们将被渲染在 Banner 的左侧区域. 这通过 Astro 的 `slot` (插槽) 特性提供了极高的灵活性.
1517

1618
### 基础用法
1719

18-
`Banner` 组件接收两个主要属性`image``imageAlt`您需要将想要在左侧显示的任何内容放置在 `<Banner>``</Banner>` 标签之间
20+
`Banner` 组件接收两个主要属性:`image``imageAlt`.您需要将想要在左侧显示的任何内容放置在 `<Banner>``</Banner>` 标签之间.
1921

2022
<MdxRepl>
2123
<Banner image={bannerImage} imageAlt="示例图片">
@@ -24,7 +26,7 @@ import bannerImage from '@/assets/shelf/desk1.png';
2426
<h2 class="text-3xl font-bold">这是主标题</h2>
2527
</div>
2628
<p class="border-l-2 border-border pl-3 text-muted-foreground mt-2">
27-
这是副标题您可以在这里写一些描述性文字
29+
这是副标题,您可以在这里写一些描述性文字.
2830
</p>
2931
</Banner>
3032
<Fragment slot="desc">
@@ -39,16 +41,16 @@ import bannerImage from '@/assets/shelf/desk1.png';
3941
<h2 class="text-3xl font-bold">这是主标题</h2>
4042
</div>
4143
<p class="border-l-2 border-border pl-3 text-muted-foreground mt-2">
42-
这是副标题您可以在这里写一些描述性文字
44+
这是副标题,您可以在这里写一些描述性文字.
4345
</p>
4446
</Banner>
4547
```
4648
</Fragment>
4749
</MdxRepl>
4850

49-
### MDX Syntax Example
51+
### MDX 用法
5052

51-
When using in an `.mdx` file, you can write Markdown directly in the slot, like this:
53+
`.mdx` 文件中使用时,您可以直接在插槽中编写 Markdown,如下所示:
5254

5355
<MdxRepl prose={true}>
5456
<Banner image={bannerImage} imageAlt="MDX Example Image">
@@ -69,38 +71,21 @@ When using in an `.mdx` file, you can write Markdown directly in the slot, like
6971
</Fragment>
7072
</MdxRepl>
7173

72-
### 组件属性 (Props)
73-
74-
| 属性 | 类型 | 是否必需 | 描述 |
75-
|---|---|---|---|
76-
| `image` | `ImageMetadata` || 用于右侧展示的图片资源, 需要从 `src` 目录导入。 |
77-
| `imageAlt` | `string` || 图片的替代文本。 |
78-
| `class` | `string` || 为组件根元素添加额外的 CSS 类。 |
79-
| `loading` | `'lazy' \| 'eager'` || 图片的加载策略,对于首屏的 Banner,推荐设置为 `eager`|
80-
81-
82-
<Banner image={bannerImage} imageAlt="MDX Example Image">
83-
## This is a Markdown Title
84-
This is a paragraph written in **Markdown** syntax.
85-
</Banner>
86-
87-
<Banner image={bannerImage} imageAlt="MDX Example Image">
88-
> This is a Markdown Title
89-
90-
</Banner>
91-
92-
### 插槽 (Slot)
93-
94-
<Aside type="info">
95-
`Banner` 组件的核心是它的默认插槽。您可以在组件标签内放置任何有效的 HTML 或 Astro 组件,它们将被渲染在 Banner 的左侧区域。
96-
</Aside>
97-
98-
<Aside type="tip" title="在 MDX 中使用">
99-
正如本页面一样,当您在 `.mdx` 文件中使用 `Banner` 组件时,可以直接在插槽中编写 Markdown 语法,它会被自动解析。
74+
<Aside type="tip" title="提示">
75+
正如本页面一样,当您在 `.mdx` 文件中使用 `Banner` 组件时,可以直接在插槽中编写 Markdown 语法,它会被自动解析.
10076
```mdx
10177
<Banner image={...}>
10278
### 我是一个 Markdown 标题
103-
这是用 **Markdown** 写的段落
79+
这是用 **Markdown** 写的段落.
10480
</Banner>
10581
```
106-
</Aside>
82+
</Aside>
83+
84+
### 组件属性 (Props)
85+
86+
| 属性 | 类型 | 是否必需 | 描述 |
87+
|---|---|---|---|
88+
| `image` | `ImageMetadata` || 用于右侧展示的图片资源, 需要从 `src` 目录导入. |
89+
| `imageAlt` | `string` || 图片的替代文本. |
90+
| `class` | `string` || 为组件根元素添加额外的 CSS 类. |
91+
| `loading` | `'lazy' \| 'eager'` || 图片的加载策略,对于首屏的 Banner,推荐设置为 `eager`. |

src/content/blog/shelf-config.mdx renamed to src/content/blog/test/test_shelf.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
title: 书架功能配置指南
2+
title: '页面配置: 书架 (Shelf)'
33
description: '如何配置和使用书架页面'
44
publishDate: 2025-10-15 22:00:00
5-
slug: shelf-config
5+
slug: shelf
66
tags: ['建站', '功能说明']
77
---
88

src/pages/archives/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
import { PostPreview } from 'astro-pure/components/pages'
2+
import { PostPreview } from '@/custom/components/pages'
33
import { getBlogCollection, groupCollectionsByYear, sortMDByDate } from 'astro-pure/server'
44
import { Button } from 'astro-pure/user'
55
import PageLayout from '@/layouts/BaseLayout.astro'

src/pages/blog/[...page].astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
import type { GetStaticPaths, Page } from 'astro'
33
import type { CollectionEntry } from 'astro:content'
44
5-
import { Paginator, PostPreview } from 'astro-pure/components/pages'
5+
import { Paginator } from 'astro-pure/components/pages'
6+
import { PostPreview } from '@/custom/components/pages'
67
import { getBlogCollection, getUniqueTags, sortMDByDate } from 'astro-pure/server'
78
import { Button, Icon } from 'astro-pure/user'
89
import PageLayout from '@/layouts/BaseLayout.astro'

0 commit comments

Comments
 (0)