Skip to content

Commit 757f51e

Browse files
committed
about 页面使用 mdx, 同时修改pageLayout 配置
1 parent add1f8d commit 757f51e

8 files changed

Lines changed: 229 additions & 32 deletions

File tree

src/components/waline/DanmakuComments.astro

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ if (serverURL) {
3232
<div id='danmaku_container' class='terminal-container my-12 mx-auto'>
3333
<div class='terminal-header'>
3434
<div class='terminal-title'>
35-
<span>弹幕装填中</span>
35+
<span style='font-family: "ZSFT-e";'>CCMTV</span>
3636
<span id='danmaku-status' class='running'>running</span>
3737
</div>
3838
<div class='terminal-controls'>
@@ -56,11 +56,13 @@ if (serverURL) {
5656

5757
<div class='status-line'>
5858
<span>Lines: <span id='danmaku-lineCount'>0</span></span>
59-
<span id='danmaku-keyboard-shortcuts'>Press <kbd>Space</kbd> to play , <kbd>C</kbd> to clear</span>
59+
<span id='danmaku-keyboard-shortcuts'
60+
>Press <kbd>Space</kbd> to play , <kbd>C</kbd> to clear</span
61+
>
6062
</div>
6163
</div>
6264

63-
<script define:vars={{ comments: recentComments }}>
65+
<script is:inline define:vars={{ comments: recentComments }}>
6466
function initializeDanmaku() {
6567
const container = document.getElementById('danmaku_container')
6668
if (!container || container.dataset.initialized) return

src/layouts/BaseLayout.astro

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ interface Props {
2121
highlightColor?: string
2222
}
2323
24+
const { meta, highlightColor, ...props } = Astro.props
2425
const {
25-
meta: { articleDate, description = config.description, ogImage, title },
26-
highlightColor,
27-
...props
28-
} = Astro.props
26+
articleDate,
27+
description = config.description,
28+
ogImage,
29+
title,
30+
} = meta || {}
2931
---
3032

3133
<html lang={config.locale.lang}>

src/layouts/CommonPage.astro

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,28 @@ import PageLayout from '@/layouts/ContentLayout.astro'
55
import { Comment, PageInfo } from '@/components/waline'
66
77
interface Props {
8-
title: string
8+
frontmatter: {
9+
title: string
10+
description?: string
11+
info?:
12+
| string
13+
| {
14+
slug: string
15+
comment?: boolean
16+
view?: boolean
17+
}
18+
}
919
headings?: MarkdownHeading[]
10-
info?:
11-
| string
12-
| {
13-
slug: string
14-
comment?: boolean,
15-
view?: boolean
16-
}
1720
}
1821
19-
const { title, info, ...props } = Astro.props
22+
const { frontmatter } = Astro.props
23+
const { title, description, info } = frontmatter
24+
2025
const view = typeof info === 'object' ? info.view : undefined
2126
const enableComment = typeof info === 'object' ? info.comment : undefined
2227
---
2328

24-
<PageLayout meta={{ title }} {...props} hasToc={false}>
29+
<PageLayout meta={{ title, description }} hasToc={false}>
2530
<Fragment slot='header'>
2631
<h1 class='text-2xl font-medium sm:mb-2 sm:text-3xl'>{title}</h1>
2732
{(view || enableComment) && <PageInfo {view} comment={enableComment} class='italic' />}
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import ToolSection from '@/components/tools/ToolSection.astro'
1414
<li>改造自己,进而改造世界🚩 <Spoiler>革命无罪,造反有理!</Spoiler></li>
1515
</ul>
1616

17+
- [edge one](https://edgeone.cloud.tencent.com/)
18+
1719
{/* general-talk */}
1820
<!-- <h2 id='hobbies'>Hobbies</h2>
1921
<ul>
@@ -189,7 +191,9 @@ import ToolSection from '@/components/tools/ToolSection.astro'
189191
>
190192
</li>
191193
<li>
192-
Site hosting: <a href='https://edgeone.cloud.tencent.com' target='_blank'>EdgeOne Pages(Tencent)</a>
194+
Site hosting: <a href='https://edgeone.cloud.tencent.com' target='_blank'
195+
>EdgeOne Pages(Tencent)</a
196+
>
193197
</li>
194198
<li>
195199
CI/CD: <a href='https://edgeone.cloud.tencent.com' target='_blank'>EdgeOne</a>

src/pages/about/index.mdx

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
---
2+
layout: ../../layouts/CommonPage.astro
3+
title: '关于'
4+
description: 'About page for catcodeme'
5+
info:
6+
slug: '/about'
7+
comment: true
8+
view: true
9+
---
10+
import { Spoiler, Timeline } from 'astro-pure/user'
11+
import Substats from '@/components/about/Substats.astro'
12+
import { ToolTag } from '@/components/tools/Tool.astro'
13+
import ToolSection from '@/components/tools/ToolSection.astro'
14+
15+
## About Me
16+
17+
* Communist / Developer / Learner / Cat owner
18+
* 改造自己,进而改造世界🚩 <Spoiler>革命无罪,造反有理!</Spoiler>
19+
20+
21+
## Tools
22+
23+
Current support tools as follow:
24+
25+
<ToolSection
26+
class='mb-5'
27+
title='Workstation (+Operating System)'
28+
tools={[
29+
{
30+
name: 'MacBook M1 Pro 14"',
31+
description: 'MacOS Sequoia 15',
32+
href: 'https://www.apple.com/mac/',
33+
icon: import('@/assets/tools/apple.svg?raw'),
34+
tags: [ToolTag.Favorite]
35+
}
36+
]}
37+
/>
38+
<ToolSection
39+
class='mb-5'
40+
title='Daily Tools'
41+
tools={[
42+
{
43+
name: 'Microsoft Edge',
44+
description: 'Browser',
45+
href: 'https://www.microsoft.com/edge',
46+
icon: import('@/assets/tools/edge.svg?raw')
47+
},
48+
{
49+
name: 'Obsidian',
50+
description: 'Tool for thought',
51+
href: 'https://obsidian.md/',
52+
icon: import('@/assets/tools/obsidian.svg?raw'),
53+
tags: [ToolTag.Free]
54+
},
55+
{
56+
name: 'Warp',
57+
description: 'Terimnal',
58+
href: 'https://www.warp.dev/',
59+
icon: import('@/assets/tools/warp.svg?raw')
60+
},
61+
{
62+
name: 'NotebookLM',
63+
description: 'AI Notebook',
64+
href: 'https://notebooklm.com/',
65+
icon: import('@/assets/tools/notebooklm.svg?raw'),
66+
tags: [ToolTag.Favorite]
67+
},
68+
{
69+
name: 'Deepseek',
70+
description: 'AI Assistant',
71+
href: 'https://deepseek.com/',
72+
icon: import('@/assets/tools/deepseek.svg?raw')
73+
},
74+
{
75+
name: 'Utools',
76+
description: 'Powerful launcher',
77+
href: 'https://u.tools/',
78+
icon: import('@/assets/tools/utools.svg?raw'),
79+
tags: [ToolTag.Favorite]
80+
},
81+
{
82+
name: 'WeRead',
83+
description: 'Reading App',
84+
href: 'https://weread.qq.com/',
85+
icon: import('@/assets/tools/weread.svg?raw'),
86+
tags: [ToolTag.Favorite]
87+
}
88+
]}
89+
/>
90+
<ToolSection
91+
class='mb-5'
92+
title='Development'
93+
tools={[
94+
{
95+
name: 'VS Code',
96+
description: 'powerful code editor',
97+
href: 'https://code.visualstudio.com/',
98+
icon: import('@/assets/tools/vscode.svg?raw')
99+
},
100+
{
101+
name: 'Intellij IDEA',
102+
description: 'Best Java IDE',
103+
href: 'https://www.jetbrains.com/idea/',
104+
icon: import('@/assets/tools/idea.svg?raw')
105+
},
106+
{
107+
name: 'GitHub Copilot',
108+
description: 'AI Coding Assistant',
109+
href: 'https://github.com/features/copilot',
110+
icon: import('@/assets/tools/githubcopilot.svg?raw'),
111+
tags: [ToolTag.Favorite]
112+
},
113+
{
114+
name: 'Gemini Pro',
115+
description: 'AI Coding Assistant',
116+
href: 'https://ai.google.dev/gemini',
117+
icon: import('@/assets/tools/gemini.svg?raw')
118+
}
119+
]}
120+
/>
121+
122+
## Social Networks
123+
124+
<Substats
125+
stats={[
126+
{
127+
platform: 'GitHub',
128+
icon: 'github',
129+
link: 'https://github.com/catcodeme',
130+
text: 'followers',
131+
api: 'github/catcodeme'
132+
},
133+
{
134+
platform: 'Bilibili',
135+
icon: 'bilibili',
136+
link: 'https://space.bilibili.com/19080963',
137+
text: 'fans',
138+
// api: 'bilibili/19080963',
139+
color: '#fe7398',
140+
count: 18
141+
}
142+
]}
143+
/>
144+
145+
## About Blog
146+
147+
Website history:
148+
149+
<Timeline
150+
events={[
151+
{
152+
date: '2025-09-17',
153+
content: '迁移到Tencent EdgeOne CDN'
154+
},
155+
{
156+
date: '2025-09-16',
157+
content: '添加备案号'
158+
},
159+
{
160+
date: '2025-07-11',
161+
content:
162+
'Website refactored from <a href="https://github.com/srleom/astro-theme-resume" target="_blank">Astro Theme Pure</a>'
163+
}
164+
]}
165+
/>
166+
167+
The smooth operation and personalized customization of website also rely on the resources and
168+
technical support provided by the following excellent projects/service providers:
169+
170+
* Framework & Theme: [Astro](https://astro.build/) + [Astro Theme Pure](https://github.com/cworld1/astro-theme-pure)
171+
* Site hosting: [EdgeOne Pages(Tencent)](https://edgeone.cloud.tencent.com)
172+
* CI/CD: [EdgeOne](https://edgeone.cloud.tencent.com)
173+
* Resources speedup: [EdgeOne](https://edgeone.cloud.tencent.com)
174+
* Comment system: [Waline](https://waline.js.org)
175+
* TotalPV: [Vercount](https://github.com/EvanNotFound/vercount)
176+
* PagePV & Comment: [Waline](https://waline.js.org/next/guide/features/pageview.html)
177+
* Icons & OgImage: from [Iconify](https://iconify.design/) & [lobehub](https://lobehub.com/icons), some icons from `GPT-4o`
178+
* Fonts: from [ZSFT](https://fonts.zeoseven.com/items/89/), current font is `JyunsaiKaai 芫茜雅楷`, 标题字体是 `ZSFT-e`

src/pages/links/index.astro

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ const { friends } = links
1818
const linksConf = config.integ.links
1919
---
2020

21-
<PageLayout title='Links' {headings} info='/links'>
21+
<PageLayout
22+
frontmatter={{ title: 'Links', info: { slug: '/links', comment: true } }}
23+
headings={headings}
24+
>
2225
<p>怎么可能有顺序呢,当然是随机的~ It's random</p>
2326
<h2 id='common-links'>Common Links</h2>
2427
<FriendList list={friends[0]} />

src/pages/msgboard/index.astro

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ import DanmakuComments from '@/components/waline/DanmakuComments.astro'
1212
loading="eager"
1313
/> -->
1414
<div class="text-left">
15-
<p class="text-xl font-semibold">留言板守则</p>
16-
<p class="text-lg mt-2 text-muted-foreground">欢迎分享你的故事、想法和新鲜事,也欢迎留下你的足迹。</p>
17-
<p class="text-lg mt-2 text-muted-foreground">请友善交流,文明发言,尊重彼此,拒绝恶意评论。</p>
18-
<p class="text-lg mt-2 text-muted-foreground">让这里成为温暖、轻松、友爱的交流空间,期待你的声音!</p>
15+
<p class="text-xl font-semibold">留言板守则</p>
16+
<p class="text-lg mt-2 text-muted-foreground">欢迎分享你的故事、想法和新鲜事,也欢迎留下你的足迹。</p>
17+
<p class="text-lg mt-2 text-muted-foreground">请友善交流,文明发言,尊重彼此,拒绝恶意评论。</p>
18+
<p class="text-lg mt-2 text-muted-foreground">让这里成为温暖、轻松、友爱的交流空间,期待你的声音!</p>
1919
</div>
2020
</div>
2121

src/pages/projects/index.astro

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,23 @@ const headings = [
1515
]
1616
---
1717

18-
<PageLayout title='Projects' {headings} info={{ slug: '/projects', comment: true }}>
18+
<PageLayout
19+
frontmatter={{ title: 'Projects', info: { slug: '/projects', comment: true } }}
20+
headings={headings}
21+
>
1922
<p>Github Activities:</p>
2023
<p>
2124
<img
22-
class="hidden dark:block"
23-
src="https://raw.githubusercontent.com/CatCodeMe/catcodeme/output/github-contribution-grid-snake-dark.svg"
24-
alt="github contribution snake dark"
25-
loading="lazy"
25+
class='hidden dark:block'
26+
src='https://raw.githubusercontent.com/CatCodeMe/catcodeme/output/github-contribution-grid-snake-dark.svg'
27+
alt='github contribution snake dark'
28+
loading='lazy'
2629
/>
2730
<img
28-
class="block dark:hidden"
29-
src="https://raw.githubusercontent.com/CatCodeMe/catcodeme/output/github-contribution-grid-snake.svg"
30-
alt="github contribution snake light"
31-
loading="lazy"
31+
class='block dark:hidden'
32+
src='https://raw.githubusercontent.com/CatCodeMe/catcodeme/output/github-contribution-grid-snake.svg'
33+
alt='github contribution snake light'
34+
loading='lazy'
3235
/>
3336
</p>
3437
<p>

0 commit comments

Comments
 (0)