跳到主要内容

3 篇博文 含有标签「hello」

查看所有标签

部署文档网站

· 阅读需 2 分钟
DingZhiyu
2023 Para team number

官方安装文档

知乎简洁教程

Ubuntu配置docusaurus环境

安装nodejs

curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs

安装Yarn

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update
sudo apt install yarn

安装

npx create-docusaurus@latest my-website classic

Rocky linux配置docusaurus环境

安装nodejs

curl -fsSL https://rpm.nodesource.com/setup_20.x | bash -
yum install -y nodejs

安装Yarn

curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
sudo dnf install yarn

安装

npx create-docusaurus@latest my-website classic

运行

cd my-website
npm start -- --port 5000

导出部署

导出静态文件,导出到build文件夹中

npm run build

部署测试

npm run serve

项目结构

my-website
├── blog
│ ├── 2019-05-28-hola.md
│ ├── 2019-05-29-hello-world.md
│ └── 2020-05-30-welcome.md
├── docs
│ ├── doc1.md
│ ├── doc2.md
│ ├── doc3.md
│ └── mdx.md
├── src
│ ├── css
│ │ └── custom.css
│ └── pages
│ ├── styles.module.css
│ └── index.js
├── static
│ └── img
├── docusaurus.config.js
├── package.json
├── README.md
├── sidebars.js
└── yarn.lock

添加对Latex公式的支持

参考官方的教程官方Latex插件教程

记得看官方的示例

插件的KaTeX CSS添加错位置会导致公式渲染错误!!!!

(也可以参考这个站的配置文件)

经验

下面这种单独出现的大写字母要放在``里,不然会报错

image-20240502205849267

h t ml添加的图片不要加zoom,不然会报错

image-20240502210229835

Welcome

· 阅读需 1 分钟
Sébastien Lorber
Docusaurus maintainer
Yangshun Tay
Front End Engineer @ Facebook

Docusaurus blogging features are powered by the blog plugin.

Simply add Markdown files (or folders) to the blog directory.

Regular blog authors can be added to authors.yml.

The blog post date can be extracted from filenames, such as:

  • 2019-05-30-welcome.md
  • 2019-05-30-welcome/index.md

A blog post folder can be convenient to co-locate blog post images:

Docusaurus Plushie

The blog supports tags as well!

And if you don't want a blog: just delete this directory, and use blog: false in your Docusaurus config.