diff --git a/README.md b/README.md index cee4a54..3e82ffa 100644 --- a/README.md +++ b/README.md @@ -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 | | toc | bool | True if the post needs a ToC | - - ### Feedback Feedbacks are welcome [here](https://github.com/Mivinci/hugo-theme-minima/issues). - diff --git a/docs/README_CN.md b/docs/README_CN.md new file mode 100644 index 0000000..2b88e9c --- /dev/null +++ b/docs/README_CN.md @@ -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 diff --git a/exampleSite/content/instruction.md b/exampleSite/content/instruction.md index 9fbd63a..95d331b 100644 --- a/exampleSite/content/instruction.md +++ b/exampleSite/content/instruction.md @@ -7,8 +7,6 @@ math: true comment: true --- - - ## Features - [x] Light/dark mode @@ -48,7 +46,7 @@ Follow [exampleSite/config.toml](https://github.com/Mivinci/hugo-theme-minima/bl ### Supported Front Matters | Field | Type | Explanation | -| :---------- | :----- | :----------------------------------------------------- | +|:----------- |:------ |:------------------------------------------------------ | | 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 | | 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 | | toc | bool | True if the post needs a ToC | - - ### Feedback Feedbacks are welcome [here](https://github.com/Mivinci/hugo-theme-minima/issues). diff --git a/exampleSite/content/markdown-syntax.md b/exampleSite/content/markdown-syntax.md index d05fd49..01ac69c 100644 --- a/exampleSite/content/markdown-syntax.md +++ b/exampleSite/content/markdown-syntax.md @@ -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. + ## Headings @@ -15,10 +16,15 @@ This article offers a sample of basic Markdown syntax that can be used in Hugo c The following HTML `

`—`

` elements represent six levels of section headings. `

` is the highest section level while `

` is the lowest. # H1 + ## H2 + ### H3 + #### H4 + ##### H5 + ###### H6 ## 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. - Name | Age ---------|------ +| Name | Age | +| ---- | --- | + Bob | 27 + Alice | 23 #### Inline Markdown within tables | Italics | Bold | Code | -| -------- | -------- | ------ | +| --------- | -------- | ------ | | *italics* | **bold** | `code` | ## Code Blocks @@ -89,8 +97,10 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou #### Code block with Hugo's internal highlight shortcode + {{< highlight html >}} + @@ -109,7 +119,6 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou 1. First item 2. Second item 3. Third item - - [x] checked - [ ] not checked @@ -128,4 +137,3 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou * Dairy * Milk * Cheese - diff --git a/exampleSite/content/math-typesetting.md b/exampleSite/content/math-typesetting.md index 542f647..638a82c 100644 --- a/exampleSite/content/math-typesetting.md +++ b/exampleSite/content/math-typesetting.md @@ -8,6 +8,7 @@ categories: ["Markdown", "KaTeX"] --- Mathematical notation in a Hugo project can be enabled by using third party JavaScript libraries. + 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 >}} {{ if or .Page.Params.math .Site.Params.math }} + + @@ -39,6 +42,7 @@ In this example we will be using [KaTeX](https://katex.org/) ### Examples {{< math.inline >}} +

Inline math: \(\varphi = \dfrac{1+\sqrt5}{2}= 1.6180339887…\)

diff --git a/exampleSite/content/placeholder-text.md b/exampleSite/content/placeholder-text.md index bf54229..860d681 100644 --- a/exampleSite/content/placeholder-text.md +++ b/exampleSite/content/placeholder-text.md @@ -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**. {{< css.inline >}} + + {{< /css.inline >}}