Skip to content

Commit 3ea4116

Browse files
committed
fix: date time display
1 parent d876abb commit 3ea4116

9 files changed

Lines changed: 190 additions & 5 deletions

File tree

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,17 @@
5252
"vite-tsconfig-paths": "5.1.4"
5353
},
5454
"simple-git-hooks": {
55-
"pre-commit": "tsx scripts/update-lastmodified.ts && pnpm exec lint-staged"
55+
"pre-commit": "pnpm exec lint-staged"
5656
},
5757
"lint-staged": {
5858
"*.{js,jsx,ts,tsx}": [
5959
"prettier --ignore-path ./.gitignore --write "
6060
],
6161
"*.{js,ts,cjs,mjs,jsx,tsx,json}": [
6262
"eslint --fix"
63+
],
64+
"*.{md,mdx}": [
65+
"pnpm update:lastmodified"
6366
]
6467
}
6568
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: Cloudflare Pages
3+
description: Guide to deploying Afilmory via Cloudflare Pages.
4+
createdAt: 2025-07-20T22:35:03+08:00
5+
lastModified: 2025-08-08T09:18:40.500+08:00
6+
---
7+
8+
# Cloudflare Pages Deployment
9+
10+
WIP
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: Github Action
3+
description: Guide to deploying Afilmory via Github Action.
4+
createdAt: 2025-07-20T22:35:03+08:00
5+
lastModified: 2025-08-08T09:18:40.504+08:00
6+
---
7+
8+
# Github Action Deployment
9+
10+
WIP
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: Github Pages
3+
description: Guide to deploying Afilmory via Github Pages.
4+
createdAt: 2025-07-20T22:35:03+08:00
5+
lastModified: 2025-08-08T09:18:40.504+08:00
6+
---
7+
8+
# Github Pages Deployment
9+
10+
WIP
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: Vercel
3+
description: Guide to deploying Afilmory via Vercel.
4+
createdAt: 2025-07-20T22:35:03+08:00
5+
lastModified: 2025-08-08T09:18:40.504+08:00
6+
---
7+
8+
# Vercel Deployment
9+
10+
WIP

packages/docs/src/components/DocumentFooter.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ export function DocumentFooter({ createdAt, lastModified }: DocumentMetaProps) {
1313
const formatDate = (dateString: string) => {
1414
try {
1515
const date = new Date(dateString)
16-
return date.toLocaleString('zh-CN', {
16+
return new Intl.DateTimeFormat('zh-CN', {
1717
year: 'numeric',
1818
month: '2-digit',
1919
day: '2-digit',
2020
hour: '2-digit',
2121
minute: '2-digit',
22-
})
22+
second: '2-digit',
23+
timeZone: 'Asia/Shanghai',
24+
}).format(date)
2325
} catch {
2426
return dateString
2527
}

packages/docs/src/routes.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@
1818
"lastModified": "2025-08-08T08:28:42.778+08:00"
1919
}
2020
},
21+
{
22+
"path": "/deployment/cloudflare-pages",
23+
"title": "Cloudflare Pages",
24+
"meta": {
25+
"title": "Cloudflare Pages",
26+
"description": "Guide to deploying Afilmory via Cloudflare Pages.",
27+
"createdAt": "2025-07-20T22:35:03+08:00",
28+
"lastModified": "2025-08-08T09:08:13.539+08:00"
29+
}
30+
},
2131
{
2232
"path": "/deployment/docker",
2333
"title": "Docker",
@@ -27,5 +37,35 @@
2737
"createdAt": "2025-07-20T22:35:03+08:00",
2838
"lastModified": "2025-08-08T08:28:42.778+08:00"
2939
}
40+
},
41+
{
42+
"path": "/deployment/github-action",
43+
"title": "Github Action",
44+
"meta": {
45+
"title": "Github Action",
46+
"description": "Guide to deploying Afilmory via Github Action.",
47+
"createdAt": "2025-07-20T22:35:03+08:00",
48+
"lastModified": "2025-08-08T09:08:13.543+08:00"
49+
}
50+
},
51+
{
52+
"path": "/deployment/github-pages",
53+
"title": "Github Pages",
54+
"meta": {
55+
"title": "Github Pages",
56+
"description": "Guide to deploying Afilmory via Github Pages.",
57+
"createdAt": "2025-07-20T22:35:03+08:00",
58+
"lastModified": "2025-08-08T09:08:13.544+08:00"
59+
}
60+
},
61+
{
62+
"path": "/deployment/vercel",
63+
"title": "Vercel",
64+
"meta": {
65+
"title": "Vercel",
66+
"description": "Guide to deploying Afilmory via Vercel.",
67+
"createdAt": "2025-07-20T22:35:03+08:00",
68+
"lastModified": "2025-08-08T09:08:13.544+08:00"
69+
}
3070
}
3171
]

packages/docs/src/routes.ts

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22
// This file is automatically generated by the route-generator plugin
33
// Do not edit manually - your changes will be overwritten
44

5-
import Route2 from '../contents/deployment/docker.mdx'
5+
import Route2 from '../contents/deployment/cloudflare-pages.mdx'
6+
import Route3 from '../contents/deployment/docker.mdx'
7+
import Route4 from '../contents/deployment/github-action.mdx'
8+
import Route5 from '../contents/deployment/github-pages.mdx'
69
import Route1 from '../contents/deployment/index.mdx'
10+
import Route6 from '../contents/deployment/vercel.mdx'
711
import Route0 from '../contents/index.mdx'
812

913
export interface RouteConfig {
@@ -37,8 +41,19 @@ export const routes: RouteConfig[] = [
3741
},
3842
},
3943
{
40-
path: '/deployment/docker',
44+
path: '/deployment/cloudflare-pages',
4145
component: Route2,
46+
title: 'Cloudflare Pages',
47+
meta: {
48+
title: 'Cloudflare Pages',
49+
description: 'Guide to deploying Afilmory via Cloudflare Pages.',
50+
createdAt: '2025-07-20T22:35:03+08:00',
51+
lastModified: '2025-08-08T09:08:13.539+08:00',
52+
},
53+
},
54+
{
55+
path: '/deployment/docker',
56+
component: Route3,
4257
title: 'Docker',
4358
meta: {
4459
title: 'Docker',
@@ -47,6 +62,39 @@ export const routes: RouteConfig[] = [
4762
lastModified: '2025-08-08T08:28:42.778+08:00',
4863
},
4964
},
65+
{
66+
path: '/deployment/github-action',
67+
component: Route4,
68+
title: 'Github Action',
69+
meta: {
70+
title: 'Github Action',
71+
description: 'Guide to deploying Afilmory via Github Action.',
72+
createdAt: '2025-07-20T22:35:03+08:00',
73+
lastModified: '2025-08-08T09:08:13.543+08:00',
74+
},
75+
},
76+
{
77+
path: '/deployment/github-pages',
78+
component: Route5,
79+
title: 'Github Pages',
80+
meta: {
81+
title: 'Github Pages',
82+
description: 'Guide to deploying Afilmory via Github Pages.',
83+
createdAt: '2025-07-20T22:35:03+08:00',
84+
lastModified: '2025-08-08T09:08:13.544+08:00',
85+
},
86+
},
87+
{
88+
path: '/deployment/vercel',
89+
component: Route6,
90+
title: 'Vercel',
91+
meta: {
92+
title: 'Vercel',
93+
description: 'Guide to deploying Afilmory via Vercel.',
94+
createdAt: '2025-07-20T22:35:03+08:00',
95+
lastModified: '2025-08-08T09:08:13.544+08:00',
96+
},
97+
},
5098
]
5199

52100
export default routes

packages/docs/src/toc-data.ts

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,19 @@ export const tocData: FileToc[] = [
199199
},
200200
],
201201
},
202+
{
203+
file: 'deployment/cloudflare-pages.mdx',
204+
path: '/deployment/cloudflare-pages',
205+
title: 'Cloudflare Pages',
206+
toc: [
207+
{
208+
id: 'heading-cloudflare-pages-deployment',
209+
level: 1,
210+
text: 'Cloudflare Pages Deployment',
211+
children: [],
212+
},
213+
],
214+
},
202215
{
203216
file: 'deployment/docker.mdx',
204217
path: '/deployment/docker',
@@ -212,6 +225,45 @@ export const tocData: FileToc[] = [
212225
},
213226
],
214227
},
228+
{
229+
file: 'deployment/github-action.mdx',
230+
path: '/deployment/github-action',
231+
title: 'Github Action',
232+
toc: [
233+
{
234+
id: 'heading-github-action-deployment',
235+
level: 1,
236+
text: 'Github Action Deployment',
237+
children: [],
238+
},
239+
],
240+
},
241+
{
242+
file: 'deployment/github-pages.mdx',
243+
path: '/deployment/github-pages',
244+
title: 'Github Pages',
245+
toc: [
246+
{
247+
id: 'heading-github-pages-deployment',
248+
level: 1,
249+
text: 'Github Pages Deployment',
250+
children: [],
251+
},
252+
],
253+
},
254+
{
255+
file: 'deployment/vercel.mdx',
256+
path: '/deployment/vercel',
257+
title: 'Vercel',
258+
toc: [
259+
{
260+
id: 'heading-vercel-deployment',
261+
level: 1,
262+
text: 'Vercel Deployment',
263+
children: [],
264+
},
265+
],
266+
},
215267
]
216268

217269
// Helper function to find TOC data by file path

0 commit comments

Comments
 (0)