跳到主要内容

Docusaurus 配置

Docusaurus 配置

1. 初始化

npm install -g pnpm

pnpm dlx create-docusaurus@latest liyilog classic

2. 快速启动

Docusaurus 已经提供了模板,只需要几行命令就能快速启动网站:

[SUCCESS] Created liyilog.
[INFO] Inside that directory, you can run several commands:

`pnpm start`
Starts the development server.

`pnpm build`
Bundles your website into static files for production.

`pnpm serve`
Serves the built website locally.

`pnpm deploy`
Publishes the website to GitHub pages.

We recommend that you begin by typing:

`cd liyilog`
`pnpm start`

Happy building awesome websites!

部署完成后,如果 3000 端口没有被占用,那么访问 localhost:3000 就能看到提供的模板页面了。

结合 TailwindCSS

安装 TailwindCSS:

pnpm add -D tailwindcss postcss autoprefixer
pnpm dlx tailwindcss init

Obsidian to Docusaurus