开始
欢迎来到我的博客!这是第一篇文章,主要用来测试博客的各项功能。
为什么搭建博客
写博客是整理思路的好方法。把模糊的想法变成文字的过程,本身就是一种思考。
写作是思考的最终形式。
技术栈
这个博客使用 Astro 构建,具备以下特性:
- 基于 Markdown 写作
- 标签分类
- 全文搜索
- RSS 订阅
- 暗色模式
- 代码高亮
代码示例
下面是一段 TypeScript 代码:
interface Post {
title: string;
description: string;
pubDate: Date;
tags: string[];
}
function getLatestPosts(posts: Post[], count: number): Post[] {
return posts
.sort((a, b) => b.pubDate.valueOf() - a.pubDate.valueOf())
.slice(0, count);
}
还有一段 CSS:
:root {
--c-bg: #fff;
--c-text: #1a1a1a;
}
html.dark {
--c-bg: #111;
--c-text: #e5e5e5;
}
下一步
接下来会写一些关于技术和生活的文章。敬请期待。