|
|
|
@ -1,111 +1,93 @@
|
|
|
|
|
# Simple Theme
|
|
|
|
|
# Cactus Plus
|
|
|
|
|
|
|
|
|
|
Simple 是一个根据 [Cactus](https://github.com/nodejh/hugo-cactus-theme) 改编的简约主题。本人在 [Cactus](https://github.com/nodejh/hugo-cactus-theme)的基础上做了一些修改,主要是添加了归档页、添加了标签页、修改了部分样式。总的来说该主题具有以下特点:
|
|
|
|
|
[English Documention](https://github.com/nodejh/hugo-theme-cactus-plus/blob/master/README.md) | [中文文档](https://github.com/nodejh/hugo-theme-cactus-plus/blob/master/README_zh-cn.md)
|
|
|
|
|
|
|
|
|
|
+ 自定义 “关于” 页面
|
|
|
|
|
+ 标签页
|
|
|
|
|
+ 归档页
|
|
|
|
|
+ Disqus 评论
|
|
|
|
|
+ 多说评论
|
|
|
|
|
+ RSS 订阅
|
|
|
|
|
+ 语法高亮
|
|
|
|
|
Cactus Plus is a minimalistic theme for bloggers based on the theme named [Cactus](https://github.com/digitalcraftsman/hugo-cactus-theme). Noteworthy features of this Hugo theme are the integration of a comment-system powered by [Disqus](https://disqus.com/) and [Duoshuo](http://duoshuo.com/), a customizable about page, a simple tags page and a minimalistic archives page, support for RSS feeds, syntax highlighting for source code and sharing options for blog posts.
|
|
|
|
|
|
|
|
|
|
![Screenshot](https://raw.githubusercontent.com/digitalcraftsman/hugo-cactus-theme/dev/images/screenshot.png)
|
|
|
|
|
## Screenshot
|
|
|
|
|
|
|
|
|
|
![Screenshot](https://github.com/nodejh/hugo-theme-cactus-plus/blob/master/images/screenshot.png)
|
|
|
|
|
|
|
|
|
|
## 安装
|
|
|
|
|
|
|
|
|
|
进入 `hugo` 的站点目录运行下面的命令:
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ cd themes
|
|
|
|
|
$ git clone https://github.com/nodejh/hugo-theme-simple.git
|
|
|
|
|
$ git clone https://github.com/nodejh/hugo-theme-cactus-plus.git
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
For more information read the official [setup guide](//gohugo.io/overview/installing/) of Hugo.
|
|
|
|
|
|
|
|
|
|
## 示例站点
|
|
|
|
|
|
|
|
|
|
[`exampleSite`](https://github.com/nodejh/hugo-theme-simple/tree/master/exampleSite) 是本主题的一个示例站点,里面有配置文件、关于页面的一些示例。
|
|
|
|
|
## Example Site
|
|
|
|
|
|
|
|
|
|
There is an example site with config file and markdown files in [`exampleSite`](https://github.com/nodejh/hugo-theme-cactus-plus/tree/master/exampleSite) directory.
|
|
|
|
|
|
|
|
|
|
### 配置文件
|
|
|
|
|
### The config file
|
|
|
|
|
|
|
|
|
|
本主题提供了一个示例配置文件是 [`exampleSite`](https://github.com/nodejh/hugo-theme-simple/tree/master/exampleSite) 目录里的 [`config.toml`](https://github.com/nodejh/hugo-theme-simple/blob/master/exampleSite/config.toml) 文件。
|
|
|
|
|
Take a look inside the [`exampleSite`](https://github.com/nodejh/hugo-theme-cactus-plus/tree/master/exampleSite) folder of this theme. You'll find a file called [`config.toml`](https://github.com/nodejh/hugo-theme-cactus-plus/blob/master/exampleSite/config.toml).
|
|
|
|
|
|
|
|
|
|
配置文件中对大部分配置都有详细的注释说明,复制该文件到站点目录下,根据自己的情况修改即可。
|
|
|
|
|
To use it, copy the [`config.toml`](https://github.com/nodejh/hugo-theme-cactus-plus/blob/master/exampleSite/config.toml) in the root folder of your Hugo site. Feel free to change strings as you like to customize your website.
|
|
|
|
|
|
|
|
|
|
## About page
|
|
|
|
|
|
|
|
|
|
## 头像
|
|
|
|
|
Use the about page to introduce yourself to your visitors. You can customize the content as you like in the [`config.toml`](//github.com/digitalcraftsman/hugo-cactus-theme/blob/dev/exampleSite/config.toml).
|
|
|
|
|
|
|
|
|
|
你可以将 [images](https://github.com/nodejh/hugo-theme-simple/blob/master/static/images/) 目录下的 `avatar.png`、`avatar@2x.png` 和 `favicon.ico` 都替换为你自己的图像。
|
|
|
|
|
## Avatar
|
|
|
|
|
|
|
|
|
|
Furthermore, you should replace the [avatar placeholder](https://github.com/nodejh/hugo-theme-cactus-plus/blob/master/static/images/) with a great image of yourself.
|
|
|
|
|
|
|
|
|
|
## 关于页面
|
|
|
|
|
## Hide pages
|
|
|
|
|
|
|
|
|
|
使用关于页面首先要在你的站点目录的 `content` 目录下创建一个 `about` 目录,然后再创建一个 `index.md` 文件,编写该文件即可。
|
|
|
|
|
Pages can be hidden and don't appear in the post list on the homepage if you add the variable `hidden = true` to the frontmatter. This allows you to link from elsewhere, i.e. just the menu.
|
|
|
|
|
|
|
|
|
|
你也可以参考本主题示例站点中的关于页:[`exampleSite/content/about/index.md`](https://github.com/nodejh/hugo-theme-simple/blob/master/exampleSite/content/about/index.md)。
|
|
|
|
|
## Disqus
|
|
|
|
|
|
|
|
|
|
This theme features a comment system powered by Disqus. Just add your Disqus-shortname to the [`config.toml`](https://github.com/nodejh/hugo-theme-cactus-plus/blob/master/exampleSite/config.toml) and set `enableDisqus = true`, then let readers respond to your blog posts.
|
|
|
|
|
|
|
|
|
|
## 隐藏页面
|
|
|
|
|
|
|
|
|
|
如果你不想让一个页面出现在文章列表中,只需要在 markdown 文件的 `frontmatter` 中添加 `hidden = true` 即可。
|
|
|
|
|
## Duoshuo
|
|
|
|
|
|
|
|
|
|
然后你可以在其他任何地方通过链接来引用该页面,如在菜单中放置一个链接。
|
|
|
|
|
This theme features a comment system powered by Duoshuo too. Duoshuo is mainly provide for Chinese users. Just add your Duoshuo-shortname to the [`config.toml`](https://github.com/nodejh/hugo-theme-cactus-plus/blob/master/exampleSite/config.toml) and set `enableDuoshuo = true`.
|
|
|
|
|
|
|
|
|
|
关于页面就是这么实现的。
|
|
|
|
|
|
|
|
|
|
## Disable Comment
|
|
|
|
|
|
|
|
|
|
## Disqus 评论
|
|
|
|
|
Just set both `enableDisqus = false` and `enableDuoshuo = false` if you want to disable comment.
|
|
|
|
|
|
|
|
|
|
本主题提供两种评论系统,Disqus 和多说。使用 Disqus 评论需要在 `config.toml` 进行设置。
|
|
|
|
|
|
|
|
|
|
设置 `disqusShortname` 为你的 Disqus ID,并将 `enableDisqus` 设置为 `true` 即可开启 Disqus 评论。
|
|
|
|
|
## Social link icons
|
|
|
|
|
|
|
|
|
|
将 `enableDisqus` 设置为 `false` 则不启用 Disqus 评论。
|
|
|
|
|
You can add a social link panel in the footer by adding entries to the `social` block in the [`config.toml`](https://github.com/nodejh/hugo-theme-cactus-plus/blob/master/exampleSite/config.toml). You can choose between two icon fonts:
|
|
|
|
|
|
|
|
|
|
- [Font awesome](https://fortawesome.github.io/Font-Awesome/) or
|
|
|
|
|
- [Mono social icons](https://github.com/drinchev/monosocialiconsfont)
|
|
|
|
|
|
|
|
|
|
## 多说评论
|
|
|
|
|
|
|
|
|
|
由于在中国大陆无法使用 Disqus,所以本主题提供了多说评论系统。多说评论系统的配置和 Disqus 配置基本一致。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## 不使用评论系统
|
|
|
|
|
|
|
|
|
|
由于使用第三发评论系统会使网站加载速度变慢,所以也可以不使用评论系统。只需要将 `enableDisqus` 和 `enableDuoshuo` 都设置为 `false` 即可。
|
|
|
|
|
|
|
|
|
|
然后我的博客由于同步到了 Github Issues,所以也同时在主题中提供了跳转到 Github Issues 评论的文字提示。只需要设置 `enableGithubIssuesTips = true` 即可。当然,一般是不需要这么做的,这可能只是我个人需求。具体效果可以参考我的博客 [http://nodejh.com](http://nodejh.com)。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## 社交链接
|
|
|
|
|
|
|
|
|
|
本主题的社交链接是字体图标的样式,并放置在了页面底部。你可以通过在 `config.toml` 的 `social` 模块中修改添加你的社交链接。社交链接提供了两种字体图标,选用其中一种即可:
|
|
|
|
|
Assign either `font-awesome` or `mono-social` to the `iconFont` variable. The Mono social icons offer three styles of icons: -circle, rounded, or default (empty).
|
|
|
|
|
|
|
|
|
|
- [Font awesome](https://fortawesome.github.io/Font-Awesome/) 或
|
|
|
|
|
- [Mono social icons](https://github.com/drinchev/monosocialiconsfont)
|
|
|
|
|
## Nearly finished
|
|
|
|
|
|
|
|
|
|
`iconFont` 变量即字体图标库,可以是 `font-awesome` 或 `mono-social`。
|
|
|
|
|
In order to see your site in action, run Hugo's built-in local server.
|
|
|
|
|
|
|
|
|
|
如果使用的是 `Mono social icons` 即 `iconFont = "mono-social"`,则图标还有三种可选样式:`-circle`、`rounded`、或默认 `empty`。
|
|
|
|
|
$ hugo server
|
|
|
|
|
|
|
|
|
|
Now enter [`localhost:1313`](http://localhost:1313) in the address bar of your browser.
|
|
|
|
|
|
|
|
|
|
## 部署主题
|
|
|
|
|
|
|
|
|
|
配置完成之后,就可以使用下面的命令来启动 hugo 服务编译 markdown 文件生成静态站点:
|
|
|
|
|
## Contributing
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ hugo server
|
|
|
|
|
```
|
|
|
|
|
Did you found a bug or got an idea for a new feature? Feel free to use the [issue tracker](//github.com/digitalcraftsman/hugo-cactus-theme/issues) to let me know. Or make directly a [pull request](//github.com/digitalcraftsman/hugo-cactus-theme/pulls).
|
|
|
|
|
|
|
|
|
|
然后在浏览器地址栏输入 [`localhost:1313`](http://localhost:1313) 来访问站点。
|
|
|
|
|
Please create a separate branch for your pull request.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
|
|
[MIT](https://github.com/nodejh/hugo-theme-simple/blob/master/LICENSE.md)
|
|
|
|
|
This theme is released under the MIT license. For more information read the [license](https://github.com/nodejh/hugo-theme-cactus-plus/blob/master/LICENSE.md).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## 鸣谢
|
|
|
|
|
## Acknowledgements
|
|
|
|
|
|
|
|
|
|
特别感谢 [digitalcraftsman](https://github.com/digitalcraftsman) 的 [Cacuts](https://github.com/digitalcraftsman/hugo-cactus-theme) 主题:
|
|
|
|
|
Thanks to
|
|
|
|
|
|
|
|
|
|
- [hugo-cactus-theme](https://github.com/digitalcraftsman/hugo-cactus-theme)
|
|
|
|
|