From 1a4e44e0fa2f661aa6b33047cc7ea06458a35121 Mon Sep 17 00:00:00 2001 From: nodejh Date: Tue, 2 Mar 2021 11:23:54 +0800 Subject: [PATCH] feat: add chinese doc --- README-zh_CN.md | 126 ++++++++++++++++++++++++++++++++++++++++ README.md | 13 +++-- exampleSite/config.yaml | 2 +- theme.toml | 4 +- 4 files changed, 136 insertions(+), 9 deletions(-) create mode 100644 README-zh_CN.md diff --git a/README-zh_CN.md b/README-zh_CN.md new file mode 100644 index 0000000..639ff9f --- /dev/null +++ b/README-zh_CN.md @@ -0,0 +1,126 @@ +# Hugo Theme Mini + +[English](https://github.com/nodejh/hugo-theme-mini/tree/master/README.md) | 简体中文 + +一个简约的响应式 Hugo 主题。 + +![./images/screenshot.png](https://raw.githubusercontent.com/nodejh/hugo-theme-mini/master/images/screenshot.png) + +- [在线 Demo](https://nodejh.github.io/hugo-theme-mini) +- [示例网站源码](https://github.com/nodejh/hugo-theme-mini/tree/master/exampleSite) + +特性: + +- 快 +- 简约 +- 响应式 +- 归档页 +- 标签页 + + +## 安装 + + +### 使用 Hugo 模块安装 (推荐) + +> ⚠️ 如果你使用的是 [二进制包](https://gohugo.io/getting-started/installing/#binary-cross-platform) 安装的 Hugo, 那么你需要在电脑上安装 Go 语言. 你可以使用下面的命令检查是否安装 Go: +> ``` +> $ go version +> ``` +> Go 语言从 v1.14 开始支持模块. [下载 Go](https://golang.org/dl/). + +1. 在项目目录初始化 hugo 模块系统,如果之前已经执行过则忽略此步骤: + + ```bash + $ hugo mod init github.com// + ``` + +2. 在 `config.yaml` 中添加主题: + + ```yaml + theme: + - github.com/nodejh/hugo-theme-mini + ``` + +### 使用 Git Submodule 安装 + + +1. 在项目目录中执行下面的命令,将 hugo-theme-mini 作为 submodule: + + ```bash + $ git submodule add https://github.com/nodejh/hugo-theme-mini.git themes/mini + ``` + +2. 在 `config.yaml` 中配置主题: + + ```yaml + theme: mini + ``` + +更多信息可参考 Hugo 官方文档 [setup guide](//gohugo.io/overview/installing/). + + +## 开始使用 + +成功安装主题后,在生成网站前还需要进行少部分的配置。 + + +### 修改配置文件 + +在 [`exampleSite`](https://github.com/nodejh/hugo-theme-mini/tree/master/exampleSite) 目录中有一个 [`config.yaml`](https://github.com/nodejh/hugo-theme-mini/blob/master/exampleSite/config.yaml) 的配置文件,你可以将其复制到你的项目根目录中,将一些配置项修改为你的配置。这些配置都可以随意修改。 + + +Take a look inside the [`exampleSite`](https://github.com/nodejh/hugo-theme-mini/tree/master/exampleSite) folder of this theme. You'll find a file called [`config.yaml`](https://github.com/nodejh/hugo-theme-mini/blob/master/exampleSite/config.yaml). To use it, copy the [`config.yaml`](https://github.com/nodejh/hugo-theme-mini/blob/master/exampleSite/config.yaml) in the root folder of your Hugo site. Feel free to change the strings in this theme. + +> ⚠️ 你需要删除这行配置: `themesDir: ../../` + +### 评论功能 + +要使用评论功能,你需要添加下面的配置: + +- 设置 Disqus: `disqusShortname: your-disqus-shorname` +- 启用评论: + + ```yaml + params: + enableComments: true + ``` + +### Google 分析 + +要使用 Google 分析功能,你需要添加下面的配置: + +- 设置 Google Analytics ID: `googleAnalytics: your-google-analytics-id` +- 启用 Google Analytics: + + ```yaml + params: + enableGoogleAnalytics: true + ``` + +### Logo 和 favicon + +你可以替换网站中的 Log 和 favicon,只需要将你的图片放在网站的 `static/images` 中,并分别命名为 `avatar.png` 和 `avicon.ico`. 下面是项目目录示例: + +``` +- content +- static +└── images + ├── avatar.png + └── favicon.ico +``` + +### 运行网站 + +为了检查网站运行情况,你可以在本地启动 hugo server: + +```bash +$ hugo server +``` + +现在你就可以在浏览器中打开 http://localhost:1313 查看你的网站了。 + + +## License + +[MIT](https://github.com/nodejh/hugo-theme-mini/blob/master/LICENSE.md) \ No newline at end of file diff --git a/README.md b/README.md index b3a5803..cee6a97 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@ # Hugo Theme Mini -A fast, minimalist and responsive hugo theme. +English | [简体中文](https://github.com/nodejh/hugo-theme-mini/tree/master/README-zh_CN.md) -![./images/screenshot.png](./images/screenshot.png) +A fast, minimalist and responsive hugo theme. +![./images/screenshot.png](https://raw.githubusercontent.com/nodejh/hugo-theme-mini/master/images/screenshot.png) - [Online demo](https://nodejh.github.io/hugo-theme-mini) - [Example Site Source](https://github.com/nodejh/hugo-theme-mini/tree/master/exampleSite) @@ -73,7 +74,7 @@ Take a look inside the [`exampleSite`](https://github.com/nodejh/hugo-theme-mini To enable comments, add following to your config file: -- DISQUS: `disqusShortname: your-disqus-shorname` +- Disqus shortname: `disqusShortname: your-disqus-shortname` - Enable Comment: ```yaml @@ -85,8 +86,8 @@ To enable comments, add following to your config file: To enable google analytics, add following to your config file: -- DISQUS: `googleAnalytics: your-google-analytics-id` -- Enable Comment: +- Google Analytics ID: `googleAnalytics: your-google-analytics-id` +- Enable Google Analytics: ```yaml params: @@ -113,7 +114,7 @@ In order to see your site in action, run Hugo's built-in local server. $ hugo server ``` -Now enter localhost:1313 in the address bar of your browser. +Now enter http://localhost:1313 in the address bar of your browser. ## License diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 76f1c1d..ede1268 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -11,7 +11,7 @@ permalinks: posts: /posts/:title/ googleAnalytics: your-google-analytics-id -disqusShortname: your-disqus-shorname +disqusShortname: your-disqus-shortname # Hugo Configure Markup # see: https://gohugo.io/getting-started/configuration-markup#highlight diff --git a/theme.toml b/theme.toml index 564fcd1..aecffe2 100644 --- a/theme.toml +++ b/theme.toml @@ -4,8 +4,8 @@ licenselink = "https://github.com/nodejh/hugo-theme-mini/blob/master/LICENSE.md" description = "A fast, minimalist and responsive hugo theme for bloggers." homepage = "https://github.com/nodejh/hugo-theme-mini" tags = ["blog", "fast", "minimalist", "responsive", "simple", "beautiful", "tags", "pages"] -features = ["fast", "minimalist", "archive", "tags"] -min_version = "0.64.0" +features = ["fast", "minimalist", "responsive", "archive", "tags"] +min_version = "0.75.0" [author] name = "nodejh"