vitepress 是一个静态博客生成器,基于 Vue3 + vite,有着以下优点:
建议使用 pnpm 来作为包管理工具,能更快的初始化
步骤
mkdir my-blog && cd my-blogpnpm 这个包管理工具来初始化项目pnpm initvitepress 依赖pnpm i vitepressmkdir docs && echo '# Hello VitePress' > docs/index.mdpackage.json{
"scripts": {
"dev": "vitepress dev docs",
"build": "vitepress build docs",
"serve": "vitepress serve docs"
}
}pnpm dev现在 VitePress 将在本地 http://localhost:3000启动,点击这个链接就可以
| Tables | Are | Cool |
| ------------- |:-------------:| -----:|
| col 3 is | right-aligned | $1600 |
| col 2 is | centered | $12 |
| zebra stripes | are neat | $1 || Tables | Are | Cool |
|---|---|---|
| col 3 is | right-aligned | $1600 |
| col 2 is | centered | $12 |
| zebra stripes | are neat | $1 |
图片通常放置在公共资源 public 下的,images 路径内 alt 属性用于在图片显示出错时给于用户提示
<img :src="('http://i0.hdslb.com/bfs/album/e6c53dc180e8e1a5dcd819cc161ee0fdc911128d.png')" alt="这是一张图片">::: tip
提示
:::
::: warning
注意
:::
::: danger
危险
:::提示
注意
危险