This commit is contained in:
Cat Tom
2024-07-26 02:07:14 +08:00
parent 5d8eafda23
commit cb5848a3f8
10 changed files with 101 additions and 115 deletions

View File

@@ -6,19 +6,17 @@
我们将通过创建一个 Python 虚拟环境以安装 Material for MkDocs。
```bash
``` bash
sudo apt -y install python3 python3-full python3-pip python3.12-venv
python3 -m venv <path>
python3 -m venv <path> # (1)
<path>/pip install --upgrade pip setuptools
<path>/pip install mkdocs-material
```
!!! warning "注意"
以上命令中的 `<path>` 请替换为 MkDocs 安装目录的绝对路径。
1. 本文所有命令中的 `<path>` 请替换为 MkDocs 安装目录的绝对路径。
这将自动安装所有依赖项的兼容版本: MkDocs、Markdown、Pygments 和 Python Markdown 扩展。
@@ -30,7 +28,7 @@ python3 -m venv <path>
切换到你希望项目所在的目录,然后输入:
```bash
``` bash
<path>/mkdocs new .
```
@@ -40,7 +38,7 @@ python3 -m venv <path>
下面提供我的配置文件,供大家参考:
```yaml title="mkdocs.yml"
``` yaml title="mkdocs.yml"
site_name: "Cat Tom's Blog" # 站点名称
site_url: https://blog.cattom.site # 站点链接
site_author: Cat Tom # 作者
@@ -141,7 +139,7 @@ plugins:
编辑完成后,您可以使用 Markdown 文件构建静态网站:
```bash
``` bash
<path>/mkdocs build
```