Mkdocs-Wcowin/docs/blog/Mkdocs/mkdocsblog.md
2024-02-02 17:11:24 +08:00

50 lines
1.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: 网站添加Mkdocs博客
tags:
- Mkdocs
---
官方文档:[Built-in blog plugin](https://squidfunk.github.io/mkdocs-material/plugins/blog/)
与所有内置插件一样博客插件的入门非常简单。只需将以下行添加到mkdocs.yml
```
plugins:
- blog
```
**然后在/docs/blog/posts下写md文件即可**无需再mkdocs.yml配置如没有post文件新建一个即可
但是bolg文件夹下要有index.md文件(没有这个文件新建即可)
在mkdocs.yml中这样写
```
- Blogger:
- index: blog/index.md
```
元标签参考:
```
---
title:
authors: [Wcowin] #作者
date: 2023-10-04 #时间
draft: true # 是否为草稿
categories: #分类
- Hello
---
```
作者信息在docs/blog/.authors.yml里配置没有.authors.yml新建即可
```yml
authors:
Wcowin:
name: Wang Kewen # Author name
description: Free and casual # Author description
avatar: https://s1.imagehub.cc/images/2024/02/02/91a767e93d1a344e44c69936464c583e.png # Author avatar
```
```
结束