Starlight 风格测试

字体测试

中文系统字体

这是一段中文正文,应该显示为系统字体(macOS 萍方 / Windows 雅黑)。

行内包含粗体斜体删除线行内代码链接

标题层级

一级标题(通常不在正文用)

二级标题

三级标题

四级标题

代码块测试(GitHub Dark 风格)

JavaScript

// 这是一个 JavaScript 代码块
const greeting = 'Hello, World!';

function sayHello(name) {
  console.log(`${greeting}, ${name}!`);
  return { success: true, timestamp: Date.now() };
}

const result = sayHello('Xiting');

TypeScript

interface User {
  id: number;
  name: string;
  email?: string;
}

class UserService {
  private users: Map<number, User> = new Map();

  async getUser(id: number): Promise<User | null> {
    return this.users.get(id) ?? null;
  }
}

Python

from dataclasses import dataclass
from typing import List

@dataclass
class Article:
    title: str
    pub_date: str
    tags: List[str]

articles: List[Article] = [
    Article("第一篇", "2026-07-21", ["test"]),
    Article("第二篇", "2026-07-22", ["blog"]),
]

for article in articles:
    print(f"{article.pub_date}: {article.title}")

Bash

# 常用命令
npm run dev      # 启动开发服务器
npm run build    # 构建生产版本
git push origin main  # 推送到远端

JSON

{
  "site": {
    "title": "Xiting's Blog",
    "description": "个人技术博客"
  },
  "features": {
    "darkMode": true,
    "comments": "giscus"
  }
}

鼠标 hover 到代码块上,右上角应该出现”复制”按钮,点击复制后变成绿色的”已复制”。

行内代码测试

配置项在 site-config.yaml 里,运行 npm run dev 启动,按 Cmd+Shift+P 上传图片。

Aside 容器测试(Starlight 风格)

4 种新类型

表格测试

类型颜色图标用途
note蓝色ℹ️备注
tip绿色💡小技巧
caution橙色⚠️注意
danger红色🚫警告

引用测试

这是一段普通引用。

可以跨多行,第二段。

列表测试

无序列表

  • 第一项
  • 第二项
    • 嵌套子项 A
    • 嵌套子项 B
  • 第三项

有序列表

  1. 第一步
  2. 第二步
  3. 第三步

任务列表

  • 已完成项
  • 未完成项
  • 另一个未完成

分割线


以上内容下方应该有一条分割线。

上一篇 【LLM&SKILL&Agent&MCP&...】概念速查 返回首页
0%