添加中文说明书

This commit is contained in:
Mivinci 2021-11-27 13:48:40 +08:00
parent 4ca99e2156
commit a06585b9ce
6 changed files with 89 additions and 13 deletions

View file

@ -56,9 +56,6 @@ Follow [exampleSite/config.toml](https://github.com/Mivinci/hugo-theme-minima/bl
| draft | bool | True if the post isn't already to production | | draft | bool | True if the post isn't already to production |
| toc | bool | True if the post needs a ToC | | toc | bool | True if the post needs a ToC |
### Feedback ### Feedback
Feedbacks are welcome [here](https://github.com/Mivinci/hugo-theme-minima/issues). Feedbacks are welcome [here](https://github.com/Mivinci/hugo-theme-minima/issues).

69
docs/README_CN.md Normal file
View file

@ -0,0 +1,69 @@
# Minima
Minima 是个简洁但功能完整的 Hugo 主题,是 [Hexo Minima](https://github.com/adisaktijrs/hexo-theme-minima) 的 Hugo 版本,但对其界面做了些调整,也添加了些功能.。示例网页:[h.xjj.pub](https://h.xjj.pub/),或直接查看作者的博客网站:[xjj.pub](https://xjj.pub)。
![screenshot](../images/tn.png)
## 功能
- [x] 暗黑模式,点击首页的 Logo 能在黑白两种模式下切换
- [x] VSCode 风格的代码高亮
- [x] KaTeX 公式
- [x] Mermaid 图表
- [x] Google 分析
- [x] Disqus、Utterances 评论插件(即将支持 Waline
- [x] 文章目录
- [x] 分类、标签、专栏
## 使用
在使用前,确保您的设备已安装了 Hugo 最新的扩展版本hugo-extended
然后确保你的博客根目录(假设为 `blog/`)处在 git 工作区,若没有,则运行下面命令
```bash
cd blog
git init
```
### 安装
在博客根目录使用 git submodule 将 minima 下载到博客的 theme 目录下
```bash
git submodule add --depth 1 https://github.com/mivinci/hugo-theme-minima.git themes/minima
```
或直接使用 git 将 minima 克隆到 theme 目录下
```bash
git clone https://github.com/mivinci/hugo-theme-minima.git themes/minima
```
总之,要将 minima 放到博客根目录的 theme 目录下。
### 主题配置
根据示例配置 [exampleSite/config.toml](https://github.com/Mivinci/hugo-theme-minima/blob/main/exampleSite/config.toml) 编辑你自己的配置文件 `博客根目录/config.toml`
### 文章配置
为缩短博客网页的加载和渲染时间minima 不支持如公式、图表、评论插件的全局配置,需要在每篇文章中设置是否启用相关插件,以下是 minima 目前支持的文章配置。
| 字段 | 类型 | 解释 |
| ----------- | ------ | --------------------------------- |
| title | string | 文章标题 |
| description | string | 文章简介,会显示在标题和正文之间 |
| date | string | 文章创建日期 |
| categories | array | 文章分类 |
| series | array | 文章专栏 |
| tags | array | 文章标签 |
| math | bool | true为该文章开启公式渲染 |
| mermaid | bool | true为该文章开启图表渲染 |
| comment | bool | true为该文章开启评论插件具体是哪个插件在博客配置文件中设置 |
| draft | bool | true该篇文章为草稿不会被打包 |
| toc | bool | true为该篇文章开启目录显示 |
### 反馈
欢迎在 [issues](https://github.com/Mivinci/hugo-theme-minima/issues) 下留言或将问题详细描述发送到我的邮箱mivinci@qq.com

View file

@ -7,8 +7,6 @@ math: true
comment: true comment: true
--- ---
## Features ## Features
- [x] Light/dark mode - [x] Light/dark mode
@ -48,7 +46,7 @@ Follow [exampleSite/config.toml](https://github.com/Mivinci/hugo-theme-minima/bl
### Supported Front Matters ### Supported Front Matters
| Field | Type | Explanation | | Field | Type | Explanation |
| :---------- | :----- | :----------------------------------------------------- | |:----------- |:------ |:------------------------------------------------------ |
| title | string | Title of the post, will be rendered in a `h1` tag | | title | string | Title of the post, will be rendered in a `h1` tag |
| description | string | Description of the post, will be rendered in a `p` tag | | description | string | Description of the post, will be rendered in a `p` tag |
| date | string | Datetime that the post is written | | date | string | Datetime that the post is written |
@ -61,8 +59,6 @@ Follow [exampleSite/config.toml](https://github.com/Mivinci/hugo-theme-minima/bl
| draft | bool | True if the post isn't already to production | | draft | bool | True if the post isn't already to production |
| toc | bool | True if the post needs a ToC | | toc | bool | True if the post needs a ToC |
### Feedback ### Feedback
Feedbacks are welcome [here](https://github.com/Mivinci/hugo-theme-minima/issues). Feedbacks are welcome [here](https://github.com/Mivinci/hugo-theme-minima/issues).

View file

@ -8,6 +8,7 @@ categories: ["Markdown"]
--- ---
This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme. This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme.
<!--more--> <!--more-->
## Headings ## Headings
@ -15,10 +16,15 @@ This article offers a sample of basic Markdown syntax that can be used in Hugo c
The following HTML `<h1>`—`<h6>` elements represent six levels of section headings. `<h1>` is the highest section level while `<h6>` is the lowest. The following HTML `<h1>`—`<h6>` elements represent six levels of section headings. `<h1>` is the highest section level while `<h6>` is the lowest.
# H1 # H1
## H2 ## H2
### H3 ### H3
#### H4 #### H4
##### H5 ##### H5
###### H6 ###### H6
## Paragraph ## Paragraph
@ -47,15 +53,17 @@ The blockquote element represents content that is quoted from another source, op
Tables aren't part of the core Markdown spec, but Hugo supports supports them out-of-the-box. Tables aren't part of the core Markdown spec, but Hugo supports supports them out-of-the-box.
Name | Age | Name | Age |
--------|------ | ---- | --- |
Bob | 27 Bob | 27
Alice | 23 Alice | 23
#### Inline Markdown within tables #### Inline Markdown within tables
| Italics | Bold | Code | | Italics | Bold | Code |
| -------- | -------- | ------ | | --------- | -------- | ------ |
| *italics* | **bold** | `code` | | *italics* | **bold** | `code` |
## Code Blocks ## Code Blocks
@ -89,8 +97,10 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou
</html> </html>
#### Code block with Hugo's internal highlight shortcode #### Code block with Hugo's internal highlight shortcode
{{< highlight html >}} {{< highlight html >}}
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
@ -109,7 +119,6 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou
1. First item 1. First item
2. Second item 2. Second item
3. Third item 3. Third item
- [x] checked - [x] checked
- [ ] not checked - [ ] not checked
@ -128,4 +137,3 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou
* Dairy * Dairy
* Milk * Milk
* Cheese * Cheese

View file

@ -8,6 +8,7 @@ categories: ["Markdown", "KaTeX"]
--- ---
Mathematical notation in a Hugo project can be enabled by using third party JavaScript libraries. Mathematical notation in a Hugo project can be enabled by using third party JavaScript libraries.
<!--more--> <!--more-->
In this example we will be using [KaTeX](https://katex.org/) In this example we will be using [KaTeX](https://katex.org/)
@ -29,7 +30,9 @@ In this example we will be using [KaTeX](https://katex.org/)
{{< math.inline >}} {{< math.inline >}}
{{ if or .Page.Params.math .Site.Params.math }} {{ if or .Page.Params.math .Site.Params.math }}
<!-- KaTeX --> <!-- KaTeX -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css" integrity="sha384-zB1R0rpPzHqg7Kpt0Aljp8JPLqbXI3bhnPWROx27a9N0Ll6ZP/+DiW/UqRcLbRjq" crossorigin="anonymous"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css" integrity="sha384-zB1R0rpPzHqg7Kpt0Aljp8JPLqbXI3bhnPWROx27a9N0Ll6ZP/+DiW/UqRcLbRjq" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.js" integrity="sha384-y23I5Q6l+B6vatafAwxRu/0oK/79VlbSz7Q9aiSZUvyWYIYsd+qj+o24G5ZU2zJz" crossorigin="anonymous"></script> <script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.js" integrity="sha384-y23I5Q6l+B6vatafAwxRu/0oK/79VlbSz7Q9aiSZUvyWYIYsd+qj+o24G5ZU2zJz" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script> <script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script>
@ -39,6 +42,7 @@ In this example we will be using [KaTeX](https://katex.org/)
### Examples ### Examples
{{< math.inline >}} {{< math.inline >}}
<p> <p>
Inline math: \(\varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887…\) Inline math: \(\varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887…\)
</p> </p>

View file

@ -37,7 +37,9 @@ Iubar proles corpore raptos vero auctor imperium; sed et huic: manus caeli Leleg
Eurytus Hector, materna ipsumque ut Politen, nec, nate, ignari, vernum cohaesit sequitur. Vel **mitis temploque** vocatus, inque alis, *oculos nomen* non silvis corpore coniunx ne displicet illa. Crescunt non unus, vidit visa quantum inmiti flumina mortis facto sic: undique a alios vincula sunt iactata abdita! Suspenderat ego fuit tendit: luna, ante urbem Propoetides **parte**. Eurytus Hector, materna ipsumque ut Politen, nec, nate, ignari, vernum cohaesit sequitur. Vel **mitis temploque** vocatus, inque alis, *oculos nomen* non silvis corpore coniunx ne displicet illa. Crescunt non unus, vidit visa quantum inmiti flumina mortis facto sic: undique a alios vincula sunt iactata abdita! Suspenderat ego fuit tendit: luna, ante urbem Propoetides **parte**.
{{< css.inline >}} {{< css.inline >}}
<style> <style>
.canon { background: white; width: 100%; height: auto; } .canon { background: white; width: 100%; height: auto; }
</style> </style>
{{< /css.inline >}} {{< /css.inline >}}