diff --git a/README.md b/README.md index c56a43c..60bf08c 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,21 @@ # 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). - -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). +> The main branch is in development stage, UI or configuration may vary. ![screenshot](./images/tn.png) ## Features -- [x] Clean -- [x] Light/dark mode -- [x] VSCode-style code hightlighting (the most alike among all Hugo themes) -- [x] KaTeX -- [x] Mermaid diagrams +- [x] Dark mode +- [x] Multilingual mode +- [x] Code highlighting - VSCode dark+ +- [x] Math - KaTeX +- [x] Flowcharts - Mermaid +- [x] Comment - Disqus, Utterances, Giscus - [x] Google analytics -- [x] Disqus/Utterances -- [x] Optional ToC -- [x] External link post +- [x] External link - [x] RSS ## Usage @@ -29,25 +24,24 @@ Before using Minima, make sure you've got Hugo (extended version) installed on y ### 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 -cd blog -git init 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 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 -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 @@ -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 | | comment | bool | True if the post allows people to make comments | | 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** - -```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" -``` +I'm currently looking for i18n contributors :) ### Feedback diff --git a/data/svg.toml b/data/svg.toml index ad37317..6e0e023 100644 --- a/data/svg.toml +++ b/data/svg.toml @@ -1,5 +1,6 @@ github = '' linkedin = '' twitter = '' +facebook = '' email = '' rss = '' diff --git a/docs/README_CN.md b/docs/README_CN.md deleted file mode 100644 index cd69634..0000000 --- a/docs/README_CN.md +++ /dev/null @@ -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 diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 4602eeb..0b3d504 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -93,10 +93,6 @@ params: # menu.main is an array containing what is used as the navigator. menu: main: - - identifier: home - name: "Home" - url: "/" - weight: 1 - identifier: tags name: "Tags" url: "/tags" @@ -105,10 +101,6 @@ menu: name: "Series" url: "/series" weight: 3 - - identifier: about - name: "About" - url: "/about" - weight: 4 # taxonomies defines ways to classify yout posts. Below are some presets that # most bloggers use, so you can replace them with whatever you like. diff --git a/exampleSite/content/markdown-syntax.md b/exampleSite/content/markdown-syntax.md index 82fbb62..3d6992f 100644 --- a/exampleSite/content/markdown-syntax.md +++ b/exampleSite/content/markdown-syntax.md @@ -2,7 +2,7 @@ author: "Hugo Authors" title: "Markdown Syntax Guide" 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"] tags: ["markdown"] --- diff --git a/i18n/en.yaml b/i18n/en.yaml index 7bcb893..dbd1ab3 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -17,6 +17,12 @@ series: timeformat: other: Jan 02, 2006 +paginator: + prev: + other: Newer + next: + other: Older + post: at: other: Post at \ No newline at end of file diff --git a/i18n/zh-cn.yaml b/i18n/zh-cn.yaml index 2ea9e96..6923136 100644 --- a/i18n/zh-cn.yaml +++ b/i18n/zh-cn.yaml @@ -17,6 +17,12 @@ series: timeformat: other: 2006 年 1 月 2 日 +paginator: + prev: + other: 上一页 + next: + other: 下一页 + post: at: other: 发布于 \ No newline at end of file diff --git a/i18n/zh-hk.yaml b/i18n/zh-hk.yaml new file mode 100644 index 0000000..dbd1ab3 --- /dev/null +++ b/i18n/zh-hk.yaml @@ -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 \ No newline at end of file diff --git a/i18n/zh-tw.yaml b/i18n/zh-tw.yaml new file mode 100644 index 0000000..dbd1ab3 --- /dev/null +++ b/i18n/zh-tw.yaml @@ -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 \ No newline at end of file diff --git a/images/screenshot-dark.png b/images/screenshot-dark.png index 1b457fc..a0d4803 100644 Binary files a/images/screenshot-dark.png and b/images/screenshot-dark.png differ diff --git a/images/screenshot.png b/images/screenshot.png index 214ec4d..de71357 100644 Binary files a/images/screenshot.png and b/images/screenshot.png differ diff --git a/images/tn.png b/images/tn.png index 1d11cba..de71357 100644 Binary files a/images/tn.png and b/images/tn.png differ diff --git a/layouts/partials/paginator.html b/layouts/partials/paginator.html index 2c22c82..721f010 100644 --- a/layouts/partials/paginator.html +++ b/layouts/partials/paginator.html @@ -2,11 +2,11 @@ {{ if gt $page.TotalPages 1 }}