# public_note **Repository Path**: atttiicus/public_note ## Basic Information - **Project Name**: public_note - **Description**: 基于 Astro 搭建的静态可公开的学习笔记网站 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-05-28 - **Last Updated**: 2026-06-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: Astro ## README # 公开笔记 一个基于 Astro 搭建的静态笔记网站,支持 LaTeX 数学公式、代码高亮、亮/暗色主题切换,以咖啡色为主色调,风格简洁书卷。 ## 功能特性 - **LaTeX 数学公式** — 通过 KaTeX 渲染,支持行内公式与展示公式 - **代码块** — Shiki 语法高亮(双主题),顶部显示语言标签,一键复制 - **目录导航** — 桌面端粘性侧边栏,移动端底部抽屉,滚动自动高亮当前章节 - **亮/暗色模式** — 跟随系统偏好,支持手动切换,偏好持久化 - **Callout 块** — 支持 `:::warning`、`:::tips`、`:::note` 语法 - **响应式布局** — 移动端与桌面端均有针对性的排版 - **过渡动画** — 页面进场、卡片 hover、抽屉滑入均有动画 ## 技术栈 | 类别 | 技术 | | -------- | ---------------------------------------------------------------------------------------------------------------- | | 框架 | [Astro 5](https://astro.build) | | UI 组件 | [React 18](https://react.dev)(交互组件) | | 样式 | [UnoCSS](https://unocss.dev)(工具类 + Typography + WebFonts) | | 动画 | [animate.css](https://animate.style) | | 数学公式 | [remark-math](https://github.com/remarkjs/remark-math) + [rehype-katex](https://github.com/remarkjs/remark-math) | | 代码高亮 | [Shiki](https://shiki.style)(内置于 Astro) | | Callout | [remark-directive](https://github.com/remarkjs/remark-directive) + 自定义插件 | | 字体 | Lora(正文)· Playfair Display(标题)· JetBrains Mono(代码) | | 语言 | TypeScript | ## 目录结构 ``` ├── astro.config.mjs # Astro 配置(集成、Markdown 插件、Shiki) ├── uno.config.ts # UnoCSS 配置(主题色、字体、排版扩展) ├── tsconfig.json ├── .editorconfig ├── .prettierrc ├── eslint.config.js ├── scripts/ │ └── fix-math.mjs # 数学公式预处理脚本($ → $$ 转换) └── src/ ├── components/ │ ├── Header.astro # 顶部导航栏(Logo、主导航、主题切换) │ ├── NoteCard.astro # 首页笔记卡片 │ ├── TableOfContents.tsx # 目录组件(桌面粘性 + 移动底部抽屉) │ └── ThemeToggle.tsx # 亮/暗色切换按钮 ├── content/ │ ├── config.ts # Content Collection Schema 定义 │ └── notes/ # 笔记文件(.md / .mdx) ├── layouts/ │ ├── BaseLayout.astro # 基础布局(HTML 骨架、防主题闪烁脚本) │ └── NoteLayout.astro # 笔记页布局(正文 + 目录双栏、代码块脚本) ├── pages/ │ ├── index.astro # 首页(Hero + 笔记列表) │ └── notes/[...slug].astro # 笔记详情页(动态路由) ├── plugins/ │ └── remark-callout.mjs # :::type 指令 →