update readme and screenshots

This commit is contained in:
Mivinci 2022-11-08 23:53:16 +08:00
parent 0ca65fbca5
commit 3da0bb149b
14 changed files with 110 additions and 168 deletions

View file

@ -1,26 +1,21 @@
# Minima # Minima
This project was originally a Hugo port of the [Hexo Minima](https://github.com/adisaktijrs/hexo-theme-minima). A lot of changes have been made so far to make Minima cooler. A clean and minimal Hugo theme porting from [Hexo Minima](https://github.com/adisaktijrs/hexo-theme-minima). See the [demo site](https://mivinci.github.io/hugo-theme-minima).
> The main branch is in development stage, UI or configuration may vary.
Links: [Demo Site](https://h.xjj.pub/), [Demo Configs](../exampleSite/), [Author's Blog](https://xjj.pub)
> The main branch is in development stage, UI or configuration may vary. You can use the latest stable version [here](https://github.com/Mivinci/hugo-theme-minima/releases/tag/v1.1.0).
![screenshot](./images/tn.png) ![screenshot](./images/tn.png)
## Features ## Features
- [x] Clean - [x] Dark mode
- [x] Light/dark mode - [x] Multilingual mode
- [x] VSCode-style code hightlighting (the most alike among all Hugo themes) - [x] Code highlighting - VSCode dark+
- [x] KaTeX - [x] Math - KaTeX
- [x] Mermaid diagrams - [x] Flowcharts - Mermaid
- [x] Comment - Disqus, Utterances, Giscus
- [x] Google analytics - [x] Google analytics
- [x] Disqus/Utterances - [x] External link
- [x] Optional ToC
- [x] External link post
- [x] RSS - [x] RSS
## Usage ## Usage
@ -29,25 +24,24 @@ Before using Minima, make sure you've got Hugo (extended version) installed on y
### Installation ### Installation
Suppose `blog` is where you place your sources. You can use either `git submodule` or `git clone` to fetch this theme into the directory where Hugo places themes.
#### Git Submodule
```bash ```bash
cd blog
git init
git submodule add --depth 1 https://github.com/mivinci/hugo-theme-minima.git themes/minima git submodule add --depth 1 https://github.com/mivinci/hugo-theme-minima.git themes/minima
``` ```
Or `clone` directly if you don't wanna use the Git submodule. #### Git Clone
```bash ```bash
git clone https://github.com/mivinci/hugo-theme-minima.git themes/minima git clone https://github.com/mivinci/hugo-theme-minima.git themes/minima
``` ```
Anyways, you just need to put Minima under the `blog/themes` directory.
### Configuration ### Configuration
Follow [exampleSite/config.toml](https://github.com/Mivinci/hugo-theme-minima/blob/main/exampleSite/config.toml) and edit your own `blog/config.toml` file. Follow [exampleSite/config.toml](https://github.com/Mivinci/hugo-theme-minima/blob/main/exampleSite/config.toml) and edit your own one.
### Supported Front Matters ### Supported Front Matters
@ -64,37 +58,11 @@ Follow [exampleSite/config.toml](https://github.com/Mivinci/hugo-theme-minima/bl
| mermaid | bool | True if the post needs to render mermaid diagrams | | mermaid | bool | True if the post needs to render mermaid diagrams |
| comment | bool | True if the post allows people to make comments | | comment | bool | True if the post allows people to make comments |
| draft | bool | True if the post isn't already for publishing | | draft | bool | True if the post isn't already for publishing |
| toc | bool | True if the post needs a ToC |
### External Link Post
Use the `link` in the front matter to make a post a specific external link. Such external link post will redirect to the link provided. ### Contribution
**Example** I'm currently looking for i18n contributors :)
```yaml
---
author: XJJ
title: External Link Post
date: 2021-07-17T10:52:59+08:00
link: https://gohugo.io
---
```
And when you click the title in the list page, you will be redireted to https://gohugo.io, which's 🆒.
### RSS Feeds
v1.1.0 and later versions support subscription to external RSS feeds whereas titles and links to your friends' posts can be displayed in your blog site. For details, see `friends` in the [configuaration](./exampleSite/config.toml)
**Example**
```yaml
[params.friends]
feeds = ["https://xjj.pub/index.xml"]
topk = 3
title = "Friends' Posts"
```
### Feedback ### Feedback

View file

@ -1,5 +1,6 @@
github = '<svg fill="#63636f" width="18" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GitHub</title><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg>' github = '<svg fill="#63636f" width="18" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GitHub</title><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg>'
linkedin = '<svg fill="#0073b1" width="18" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>LinkedIn</title><path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"/></svg>' linkedin = '<svg fill="#0073b1" width="18" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>LinkedIn</title><path d="M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"/></svg>'
twitter = '<svg fill="#1da1f2" width="18" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Twitter</title><path d="M23.954 4.569c-.885.389-1.83.654-2.825.775 1.014-.611 1.794-1.574 2.163-2.723-.951.555-2.005.959-3.127 1.184-.896-.959-2.173-1.559-3.591-1.559-2.717 0-4.92 2.203-4.92 4.917 0 .39.045.765.127 1.124C7.691 8.094 4.066 6.13 1.64 3.161c-.427.722-.666 1.561-.666 2.475 0 1.71.87 3.213 2.188 4.096-.807-.026-1.566-.248-2.228-.616v.061c0 2.385 1.693 4.374 3.946 4.827-.413.111-.849.171-1.296.171-.314 0-.615-.03-.916-.086.631 1.953 2.445 3.377 4.604 3.417-1.68 1.319-3.809 2.105-6.102 2.105-.39 0-.779-.023-1.17-.067 2.189 1.394 4.768 2.209 7.557 2.209 9.054 0 13.999-7.496 13.999-13.986 0-.209 0-.42-.015-.63.961-.689 1.8-1.56 2.46-2.548l-.047-.02z"/></svg>' twitter = '<svg fill="#1da1f2" width="18" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Twitter</title><path d="M23.954 4.569c-.885.389-1.83.654-2.825.775 1.014-.611 1.794-1.574 2.163-2.723-.951.555-2.005.959-3.127 1.184-.896-.959-2.173-1.559-3.591-1.559-2.717 0-4.92 2.203-4.92 4.917 0 .39.045.765.127 1.124C7.691 8.094 4.066 6.13 1.64 3.161c-.427.722-.666 1.561-.666 2.475 0 1.71.87 3.213 2.188 4.096-.807-.026-1.566-.248-2.228-.616v.061c0 2.385 1.693 4.374 3.946 4.827-.413.111-.849.171-1.296.171-.314 0-.615-.03-.916-.086.631 1.953 2.445 3.377 4.604 3.417-1.68 1.319-3.809 2.105-6.102 2.105-.39 0-.779-.023-1.17-.067 2.189 1.394 4.768 2.209 7.557 2.209 9.054 0 13.999-7.496 13.999-13.986 0-.209 0-.42-.015-.63.961-.689 1.8-1.56 2.46-2.548l-.047-.02z"/></svg>'
facebook = '<svg fill="#63636f" width="22" height="22" viewBox="0 0 24 24"><path d="M22 12c0-5.52-4.48-10-10-10S2 6.48 2 12c0 4.84 3.44 8.87 8 9.8V15H8v-3h2V9.5C10 7.57 11.57 6 13.5 6H16v3h-2c-.55 0-1 .45-1 1v2h3v3h-3v6.95c5.05-.5 9-4.76 9-9.95z"/></svg>'
email = '<svg fill="#63636f" width="22" height="22" viewBox="0 0 24 24"><path d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm9.06 8.683L5.648 6.238L4.353 7.762l7.72 6.555l7.581-6.56l-1.308-1.513l-6.285 5.439z"/></svg>' email = '<svg fill="#63636f" width="22" height="22" viewBox="0 0 24 24"><path d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm9.06 8.683L5.648 6.238L4.353 7.762l7.72 6.555l7.581-6.56l-1.308-1.513l-6.285 5.439z"/></svg>'
rss = '<svg fill="#63636f" t="1626591563876" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1984" width="18" height="16"><path d="M128 768a128 128 0 1 0 0 256 128 128 0 0 0 0-256zM0 368v176c265.104 0 480 214.912 480 480h176c0-362.32-293.696-656-656-656zM0 0v176c468.336 0 848 379.664 848 848h176C1024 458.464 565.536 0 0 0z" p-id="1985"></path></svg>' rss = '<svg fill="#63636f" t="1626591563876" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1984" width="18" height="16"><path d="M128 768a128 128 0 1 0 0 256 128 128 0 0 0 0-256zM0 368v176c265.104 0 480 214.912 480 480h176c0-362.32-293.696-656-656-656zM0 0v176c468.336 0 848 379.664 848 848h176C1024 458.464 565.536 0 0 0z" p-id="1985"></path></svg>'

View file

@ -1,105 +0,0 @@
# Minima
Minima 是个简洁但功能完整的 Hugo 主题,原本是 [Hexo Minima](https://github.com/adisaktijrs/hexo-theme-minima) 主题的 Hugo 版本,现在已经在其设计行上做了多处调整,和添加新的功能。
链接:[示例网页](https://h.xjj.pub/)[示例配置](../exampleSite/config.toml)[作者博客](https://xjj.pub)
![screenshot](../images/tn.png)
## 功能
- [x] 暗黑模式,点击首页的 Logo 能在黑白两种模式下切换
- [x] VSCode 风格的代码高亮
- [x] KaTeX 公式
- [x] Mermaid 图表
- [x] Google 分析
- [x] Disqus、Utterances 评论插件(即将支持 Waline
- [x] 文章目录
- [x] 分类、标签、专栏
- [x] 外部链接
- [x] RSS
## 使用
在使用前,确保您的设备已安装了 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 | 文章创建日期 |
| link | string | 外部链接 |
| categories | array | 文章分类 |
| series | array | 文章专栏 |
| tags | array | 文章标签 |
| math | bool | true为该文章开启公式渲染 |
| mermaid | bool | true为该文章开启图表渲染 |
| comment | bool | true为该文章开启评论插件具体是哪个插件在博客配置文件中设置 |
| draft | bool | true该篇文章为草稿不会被打包 |
| toc | bool | true为该篇文章开启目录显示 |
### 外部链接
可在 front matter 中通过设置 `link` 来创建外部链接。
**示例**
```yaml
---
author: XJJ
title: External Link Post
date: 2021-07-17T10:52:59+08:00
link: https://gohugo.io
---
```
当点击改文章题目时,会跳转到设置的链接地址 https://gohugo.io🆒
### RSS Feeds
v1.1.0 版本之后Minima 支持订阅 RSS Feeds因此你可以用来在自己的博客上显示别人的文章标题和链接。详情见 [示例配置](./exampleSite/config.toml) 的 `friends` 部分。
**示例**
```yaml
[params.friends]
feeds = ["https://xjj.pub/index.xml"]
topk = 3
title = "Friends' Posts"
```
### 反馈
欢迎在 [issues](https://github.com/Mivinci/hugo-theme-minima/issues) 下留言或将问题详细描述发送到我的邮箱i@xjj.pub

View file

@ -93,10 +93,6 @@ params:
# menu.main is an array containing what is used as the navigator. # menu.main is an array containing what is used as the navigator.
menu: menu:
main: main:
- identifier: home
name: "Home"
url: "/"
weight: 1
- identifier: tags - identifier: tags
name: "Tags" name: "Tags"
url: "/tags" url: "/tags"
@ -105,10 +101,6 @@ menu:
name: "Series" name: "Series"
url: "/series" url: "/series"
weight: 3 weight: 3
- identifier: about
name: "About"
url: "/about"
weight: 4
# taxonomies defines ways to classify yout posts. Below are some presets that # taxonomies defines ways to classify yout posts. Below are some presets that
# most bloggers use, so you can replace them with whatever you like. # most bloggers use, so you can replace them with whatever you like.

View file

@ -2,7 +2,7 @@
author: "Hugo Authors" author: "Hugo Authors"
title: "Markdown Syntax Guide" title: "Markdown Syntax Guide"
date: "2021-07-18T10:52:59+08:00" date: "2021-07-18T10:52:59+08:00"
description: "Sample article showcasing basic Markdown syntax and formatting for HTML elements." description: "Sample article showcasing basic Markdown syntax."
categories: ["markdown"] categories: ["markdown"]
tags: ["markdown"] tags: ["markdown"]
--- ---

View file

@ -17,6 +17,12 @@ series:
timeformat: timeformat:
other: Jan 02, 2006 other: Jan 02, 2006
paginator:
prev:
other: Newer
next:
other: Older
post: post:
at: at:
other: Post at other: Post at

View file

@ -17,6 +17,12 @@ series:
timeformat: timeformat:
other: 2006 年 1 月 2 日 other: 2006 年 1 月 2 日
paginator:
prev:
other: 上一页
next:
other: 下一页
post: post:
at: at:
other: 发布于 other: 发布于

28
i18n/zh-hk.yaml Normal file
View file

@ -0,0 +1,28 @@
recent:
other: Recent Posts
older:
other: Older Posts
home:
other: Home
about:
other: About
categories:
other: Categories
tags:
other: Tags
series:
other: Series
timeformat:
other: Jan 02, 2006
paginator:
prev:
other: Newer
next:
other: Older
post:
at:
other: Post at

28
i18n/zh-tw.yaml Normal file
View file

@ -0,0 +1,28 @@
recent:
other: Recent Posts
older:
other: Older Posts
home:
other: Home
about:
other: About
categories:
other: Categories
tags:
other: Tags
series:
other: Series
timeformat:
other: Jan 02, 2006
paginator:
prev:
other: Newer
next:
other: Older
post:
at:
other: Post at

Binary file not shown.

Before

Width:  |  Height:  |  Size: 191 KiB

After

Width:  |  Height:  |  Size: 178 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 200 KiB

After

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 KiB

After

Width:  |  Height:  |  Size: 195 KiB

View file

@ -2,11 +2,11 @@
{{ if gt $page.TotalPages 1 }} {{ if gt $page.TotalPages 1 }}
<div class="mt-6 flex justify-between font-semibold"> <div class="mt-6 flex justify-between font-semibold">
{{ if $page.HasPrev }} {{ if $page.HasPrev }}
<a href="{{ $page.Prev.URL }}">Newer</a> <a href="{{ $page.Prev.URL }}">{{ T "paginator.prev" }}</a>
{{ end }} {{ end }}
{{ if $page.HasNext }} {{ if $page.HasNext }}
<a href="{{ $page.Next.URL }}">Older</a> <a href="{{ $page.Next.URL }}">{{ T "paginator.next" }}</a>
{{ end }} {{ end }}
</div> </div>
{{ end }} {{ end }}

View file

@ -4,11 +4,29 @@
name = "Minima" name = "Minima"
license = "MIT" license = "MIT"
licenselink = "https://github.com/mivinci/minima/blob/master/LICENSE" licenselink = "https://github.com/mivinci/minima/blob/master/LICENSE"
description = "A Hugo port of Hexo Minima" description = "A clean and minimal Hugo theme"
homepage = "https://github.com/mivinci/hugo-theme-minima" homepage = "https://github.com/mivinci/hugo-theme-minima"
tags = ["minimal", "clean", "blog", "responsive", "personal", "simple", "minimalist", "portfolio", "dark"] tags = [
features = ["Dark mode", "KaTeX", "Mermaid", "VSCode-style code highlighting", "External link post"] "minimal",
min_version = "0.41.0" "clean",
"blog",
"responsive",
"personal",
"simple",
"minimalist",
"portfolio",
"dark",
]
features = [
"Dark mode",
"Multilingual mode",
"KaTeX",
"Mermaid",
"Code highlighting",
"External link",
"RSS",
]
min_version = "0.85.0"
[author] [author]
name = "Mivinci" name = "Mivinci"