Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejh/hugo-theme-cactus-plus.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl van Heijster <Karl.vanHeijster@cito.nl>2021-08-20 09:29:55 +0300
committerKarl van Heijster <Karl.vanHeijster@cito.nl>2021-08-20 09:29:55 +0300
commitcbbebda38158df9135954f42241442f8ca2a6778 (patch)
treee7b3e3f4db01d13ef66454e13ed37e2b17b846ee
parent86e4e6f932ce1117fe52a75cd7e107f8f2a667fe (diff)
parentc293a33d4713edb3ab9879127e1789d2866af155 (diff)
Merge branch 'master' of https://github.com/nodejh/hugo-theme-mini into i18n
-rw-r--r--CHANGELOG4
-rw-r--r--README-zh_CN.md127
-rw-r--r--README.md93
-rw-r--r--exampleSite/config.yaml36
-rw-r--r--exampleSite/content/about/_index.md1
-rw-r--r--exampleSite/content/posts/emoji-support.md1
-rw-r--r--exampleSite/content/posts/rich-content.md1
-rw-r--r--exampleSite/content/posts/test.md84
-rw-r--r--layouts/404.html1
-rw-r--r--layouts/_default/_markup/render-link.html14
-rw-r--r--layouts/_default/single.html8
-rw-r--r--layouts/index.html4
-rw-r--r--layouts/partials/comment.html2
-rw-r--r--layouts/partials/footer.html23
-rw-r--r--layouts/partials/head.html17
-rw-r--r--layouts/partials/math.html5
-rw-r--r--layouts/partials/social.html2
-rw-r--r--layouts/partials/toc.html10
-rw-r--r--static/css/style.css39
19 files changed, 400 insertions, 72 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 102ade0..fa7fb80 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,7 @@
+## 2021.03.01 Version 2.1.0
+
+- [x] Adding ability to disable disqus comments on a single post
+
## 2021.03.01 Version 2.0.0
- [x] Refactor
diff --git a/README-zh_CN.md b/README-zh_CN.md
index 639ff9f..824e29f 100644
--- a/README-zh_CN.md
+++ b/README-zh_CN.md
@@ -9,7 +9,7 @@
- [在线 Demo](https://nodejh.github.io/hugo-theme-mini)
- [示例网站源码](https://github.com/nodejh/hugo-theme-mini/tree/master/exampleSite)
-特性:
+特性:
- 快
- 简约
@@ -18,91 +18,89 @@
- 标签页
-## 安装
+## 1. 安装
-### 使用 Hugo 模块安装 (推荐)
+### 1.1 使用 Hugo 模块安装 (推荐)
-> ⚠️ 如果你使用的是 [二进制包](https://gohugo.io/getting-started/installing/#binary-cross-platform) 安装的 Hugo, 那么你需要在电脑上安装 Go 语言. 你可以使用下面的命令检查是否安装 Go:
+> ⚠️ 如果你使用的是 [二进制包](https://gohugo.io/getting-started/installing/#binary-cross-platform) 安装的 Hugo,那么你需要在电脑上安装 Go 语言。 你可以使用下面的命令检查是否安装 Go:
> ```
> $ go version
> ```
-> Go 语言从 v1.14 开始支持模块. [下载 Go](https://golang.org/dl/).
+> Go 语言从 v1.14 开始支持模块. [下载 Go](https://golang.org/dl/)。
-1. 在项目目录初始化 hugo 模块系统,如果之前已经执行过则忽略此步骤:
+1. 在项目目录初始化 hugo 模块系统,如果之前已经执行过则忽略此步骤:
```bash
$ hugo mod init github.com/<your_user>/<your_project>
```
-2. 在 `config.yaml` 中添加主题:
+2. 在 `config.yaml` 中添加主题:
```yaml
theme:
- github.com/nodejh/hugo-theme-mini
```
-### 使用 Git Submodule 安装
+### 1.2 使用 Git Submodule 安装
-1. 在项目目录中执行下面的命令,将 hugo-theme-mini 作为 submodule:
+1. 在项目目录中执行下面的命令,将 hugo-theme-mini 作为 submodule:
```bash
$ git submodule add https://github.com/nodejh/hugo-theme-mini.git themes/mini
```
-2. 在 `config.yaml` 中配置主题:
+2. 在 `config.yaml` 中配置主题:
```yaml
theme: mini
```
-更多信息可参考 Hugo 官方文档 [setup guide](//gohugo.io/overview/installing/).
+更多信息可参考 Hugo 官方文档 [setup guide](//gohugo.io/overview/installing/)。
-## 开始使用
+## 2. 开始使用
成功安装主题后,在生成网站前还需要进行少部分的配置。
-### 修改配置文件
+### 2.1 修改配置文件
在 [`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: ../../` 。
-> ⚠️ 你需要删除这行配置: `themesDir: ../../`
+### 2.2 评论功能
-### 评论功能
+要使用评论功能,你需要添加下面的配置:
-要使用评论功能,你需要添加下面的配置:
-
-- 设置 Disqus: `disqusShortname: your-disqus-shorname`
-- 启用评论:
+- 设置 Disqus: `disqusShortname: your-disqus-shorname`
+- 启用评论:
```yaml
params:
enableComments: true
```
-### Google 分析
+### 2.3 Google 分析
-要使用 Google 分析功能,你需要添加下面的配置:
+要使用 Google 分析功能,你需要添加下面的配置:
-- 设置 Google Analytics ID: `googleAnalytics: your-google-analytics-id`
-- 启用 Google Analytics:
+- 设置 Google Analytics ID: `googleAnalytics: your-google-analytics-id`
+- 启用 Google Analytics:
```yaml
params:
enableGoogleAnalytics: true
```
-### Logo 和 favicon
+### 2.4 Logo 和 favicon
-你可以替换网站中的 Log 和 favicon,只需要将你的图片放在网站的 `static/images` 中,并分别命名为 `avatar.png` 和 `avicon.ico`. 下面是项目目录示例:
+你可以替换网站中的 Log 和 favicon,只需要将你的图片放在网站的 `static/images` 中,并分别命名为 `avatar.png` 和 `avicon.ico`。下面是项目目录示例:
-```
+```shell
- content
- static
└── images
@@ -110,9 +108,9 @@ Take a look inside the [`exampleSite`](https://github.com/nodejh/hugo-theme-mini
└── favicon.ico
```
-### 运行网站
+### 2.5 运行网站
-为了检查网站运行情况,你可以在本地启动 hugo server:
+为了检查网站运行情况,你可以在本地启动 hugo server:
```bash
$ hugo server
@@ -120,6 +118,77 @@ $ hugo server
现在你就可以在浏览器中打开 http://localhost:1313 查看你的网站了。
+### 2.6 生产环境
+
+如果要将网站部署到生产环境 (例如支持 Google Analytics),你需要在 `hugo` 命令前增加环境变量 `HUGO_ENV=production`。例如:
+
+```bash
+HUGO_ENV=production hugo
+```
+
+注意:上面的命令对 Windows 无效。如你使用 Windows,则需要使用下面的命令:
+
+```bash
+set HUGO_ENV=production
+hugo
+```
+
+## 3. 可选配置
+
+### 3.1 Table of Content
+
+如果要启用目录,你可以将 `showToc` 设置为 `true`:
+
+```yaml
+showToc: true
+```
+
+
+### 3.2 在某页面禁用评论
+
+要在某页面禁用评论,你可以在页面的 Front Matter 中将 `enableComments` 设置为 `false`。
+
+例如:
+
+```yaml
+---
+title: Some title
+enableComments: false
+---
+```
+
+### 3.3 自定义 CSS 和 JS
+
+你可以将自定义 CSS 和 JS 放在 `static` 中,也可以使用远程的 CSS 或 JS 文件。
+
+例如:
+
+```yaml
+customCSS:
+ - css/custom.css # local css in `static/css/custom.css`
+ - https://example.com/custom.css # remote css
+customJS:
+ - js/custom.js # local js in `static/js/custom.js`
+ - https://example.com/custom.js # remote js
+```
+
+
+### 3.4 数学排版
+
+该主题使用了 [KaTeX](https://katex.org/) 来支持数学符号拍版。
+
+- 全局支持数学排版:在项目的配置文件中将 `math` 设置为 `true`
+- 在某页面支持数学拍版:在某页面 Front Matter 中将 `math` 设置为 `true`
+
+### 3.5 在首页隐藏文章摘要
+
+如果要在首页隐藏文章摘要,你可以将 `hiddenPostSummaryInHomePage` 设置为 `true`,默认是 `false`。
+
+例如:
+
+```yaml
+hiddenPostSummaryInHomePage: true
+```
## License
diff --git a/README.md b/README.md
index cee6a97..7ce417d 100644
--- a/README.md
+++ b/README.md
@@ -18,10 +18,10 @@ Features:
- Tags
-## Installation
+## 1. Installation
-### As a Hugo Module (recommended)
+### 1.1 As a Hugo Module (recommended)
> ⚠️ If you installed a [Hugo binary](https://gohugo.io/getting-started/installing/#binary-cross-platform), you may not have Go installed on your machine. To check if Go is installed:
> ```
@@ -42,7 +42,7 @@ Features:
- github.com/nodejh/hugo-theme-mini
```
-### As Git Submodule
+### 1.2 As Git Submodule
1. Inside the folder of your Hugo site run:
@@ -59,18 +59,18 @@ Features:
For more information read the official [setup guide](//gohugo.io/overview/installing/) of Hugo.
-## Getting started
+## 2. Getting started
After installing the theme successfully it requires a just a few more steps to get your site running.
-### The config file
+### 2.1 The config file
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.
> ⚠️ You may need to delete the line: `themesDir: ../../`
-### Add Comments
+### 2.2 Add Comments
To enable comments, add following to your config file:
@@ -82,7 +82,7 @@ To enable comments, add following to your config file:
enableComments: true
```
-### Google Analytics
+### 2.3 Google Analytics
To enable google analytics, add following to your config file:
@@ -94,7 +94,7 @@ To enable google analytics, add following to your config file:
enableGoogleAnalytics: true
```
-### Logo and favicon
+### 2.4 Logo and favicon
You can replace the log in the top of each page and favicon with your own images. To do that put your own logo and favicon into the `images` directory of your website static directory, then named them `avatar.png` and `favicon.ico`. For example:
@@ -106,7 +106,7 @@ You can replace the log in the top of each page and favicon with your own images
└── favicon.ico
```
-### Nearly finished
+### 2.5 Nearly finished
In order to see your site in action, run Hugo's built-in local server.
@@ -116,6 +116,79 @@ $ hugo server
Now enter http://localhost:1313 in the address bar of your browser.
+### 2.6 Production
+
+To run in production (e.g. to have Google Analytics show up), run HUGO_ENV=production before your build command. For example:
+
+```bash
+HUGO_ENV=production hugo
+```
+
+Note: The above command will not work on Windows. If you are running a Windows OS, use the below command:
+
+```bash
+set HUGO_ENV=production
+hugo
+```
+
+
+## 3. Optional Configuration
+
+### 3.1 Table of Content
+
+To enable table of content, you could set `showToc` to `true`.
+
+For example:
+
+```yaml
+showToc: true
+```
+
+### 3.2 Disable Comments on a single post
+
+You can set `enableComments` to `false` in front matter to disable disqus comments on a single post.
+
+For example:
+
+```yaml
+---
+title: Some title
+enableComments: false
+---
+```
+
+### 3.3 Custom CSS and JS
+
+You can put your custom css and js files to `static` directory, or use remote css and js files which start with `http://` or `https://`.
+
+For example:
+
+```yaml
+customCSS:
+ - css/custom.css # local css in `static/css/custom.css`
+ - https://example.com/custom.css # remote css
+customJS:
+ - js/custom.js # local js in `static/js/custom.js`
+ - https://example.com/custom.js # remote js
+```
+
+### 3.4 Math Typesetting
+
+Mathematical notation is enabled by [KaTeX](https://katex.org/).
+
+- To enable KaTex globally set the parameter `math` to `true` in project’s configuration
+- To enable KaTex on a per page basis include the parameter `math` to `true` in content files
+
+### 3.5 Hidden Post Summary in Home Page
+
+To hidden post summary in home page, you could set `hiddenPostSummaryInHomePage` to `true`, default is `false`.
+
+For example:
+
+```yaml
+hiddenPostSummaryInHomePage: true
+```
+
## License
-[MIT](https://github.com/nodejh/hugo-theme-mini/blob/master/LICENSE.md) \ No newline at end of file
+[MIT](https://github.com/nodejh/hugo-theme-mini/blob/master/LICENSE.md)
diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml
index c129e52..b5caf30 100644
--- a/exampleSite/config.yaml
+++ b/exampleSite/config.yaml
@@ -14,12 +14,15 @@ googleAnalytics: your-google-analytics-id
disqusShortname: your-disqus-shortname
# Hugo Configure Markup
-# see: https://gohugo.io/getting-started/configuration-markup#highlight
+# more info: https://gohugo.io/getting-started/configuration-markup#
markup:
highlight:
guessSyntax: true
style: emacs
-
+ tableOfContents:
+ endLevel: 3
+ ordered: false
+ startLevel: 2
# Social links in footer, support github,twitter,stackoverflow,facebook
social:
@@ -38,13 +41,28 @@ params:
bio: Software Engineer
# Site Description, used in HTML meat
description: My Blog
+
+
+ ###########################################
+ # Optional
+ ###########################################
+
+ # To enable RSS, you could set `enableRSS: true`, default is `true`
enableRSS: true
# To enable comments, you may need to set `disqusShortname`
enableComments: true
# To enable comments, you may need to set `googleAnalytics`
enableGoogleAnalytics: true
+ # To enable table of content, you could set `showToc: true`, default is `false`
+ showToc: true
+ # To hidden powerBy message in the page footer, you could set: `showPowerBy: false`, default is `true`
+ showPowerBy: true
+ # To enable math typesetting , you could set `math: true`, default is `false`
+ math: false
+ # To hidden post summary in home page, you could set `hiddenPostSummaryInHomePage: true`, default is `false`
+ hiddenPostSummaryInHomePage: false
- # Optional
+ # text in page
home: '' # Default: Home
about: '' # Default: About
archive: '' # Default: Archive
@@ -59,6 +77,16 @@ params:
# Extra links in navigation
links:
- # e.g.
+ ## e.g.
# - name: Project
# path: /project
+
+ # You can put your custom css and js to `static` directory, or use remote css and js files which start with `http://` or `https://`
+ customCSS:
+ ## e.g.
+ # - css/custom.css # local css in `static/css/custom.css`
+ # - https://example.com/custom.css # remote css
+ customJS:
+ ## e.g.
+ # - js/custom.js # local js in `static/js/custom.js`
+ # - https://example.com/custom.js # remote js \ No newline at end of file
diff --git a/exampleSite/content/about/_index.md b/exampleSite/content/about/_index.md
index b31bf1d..7cb001a 100644
--- a/exampleSite/content/about/_index.md
+++ b/exampleSite/content/about/_index.md
@@ -4,6 +4,7 @@ description = "Hugo, the world's fastest framework for building websites"
date = "2019-02-28"
aliases = ["about-us", "about-hugo", "contact"]
author = "Hugo Authors"
+enableComments = false
+++
Written in Go, Hugo is an open source static site generator available under the [Apache Licence 2.0.](https://github.com/gohugoio/hugo/blob/master/LICENSE) Hugo supports TOML, YAML and JSON data file types, Markdown and HTML content files and uses shortcodes to add rich content. Other notable features are taxonomies, multilingual mode, image processing, custom output formats, HTML/CSS/JS minification and support for Sass SCSS workflows.
diff --git a/exampleSite/content/posts/emoji-support.md b/exampleSite/content/posts/emoji-support.md
index dc3589a..5b464de 100644
--- a/exampleSite/content/posts/emoji-support.md
+++ b/exampleSite/content/posts/emoji-support.md
@@ -6,6 +6,7 @@ description = "Guide to emoji usage in Hugo"
tags = [
"emoji",
]
+
+++
Emoji can be enabled in a Hugo project in a number of ways.
diff --git a/exampleSite/content/posts/rich-content.md b/exampleSite/content/posts/rich-content.md
index 92b4b03..c1ea871 100644
--- a/exampleSite/content/posts/rich-content.md
+++ b/exampleSite/content/posts/rich-content.md
@@ -7,6 +7,7 @@ tags = [
"shortcodes",
"privacy",
]
+draft = true
+++
Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-management/shortcodes/#use-hugos-built-in-shortcodes) for rich content, along with a [Privacy Config](https://gohugo.io/about/hugo-and-gdpr/) and a set of Simple Shortcodes that enable static and no-JS versions of various social media embeds.
diff --git a/exampleSite/content/posts/test.md b/exampleSite/content/posts/test.md
new file mode 100644
index 0000000..f2dbc9f
--- /dev/null
+++ b/exampleSite/content/posts/test.md
@@ -0,0 +1,84 @@
++++
+author = "Test"
+title = "Code Content"
+date = "2021-03-10"
+description = "A brief description of Hugo Shortcodes"
+tags = [
+ "shortcodes",
+ "privacy",
+]
+draft = true
++++
+
+## t1
+
+aaaa
+
+
+Test [aaa](http://example.com) text.
+
+### t1.1
+
+aaaa
+
+
+### t1.2
+
+aaaa
+
+
+#### t1.2.1
+
+aaaa
+
+
+#### t1.2.2
+
+aaaa
+
+
+## t2
+
+aaaa
+
+## t3
+
+1. One<br><br>
+
+/```
+testing
+some
+code
+/```
+
+2. Two<br><br>
+3. Three<br><br>
+
+超宽显示 `var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";var a = "text";` 超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示超宽显示 `var a = "text";`
+
+```
+2021-08-02 17:51:23.718 ERROR org.apache.flink.runtime.entrypoint.ClusterEntrypoint [] - Fatal error occurred in the cluster entrypoint.
+org.apache.flink.util.FlinkException: Application failed unexpectedly.
+ at org.apache.flink.client.deployment.application.ApplicationDispatcherBootstrap.lambda$runApplicationAndShutdownClusterAsync$0(ApplicationDispatcherBootstrap.java:170) ~[flink-dist_2.12-1.13.1.jar:1.13.1]
+ at java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:836) ~[?:1.8.0_292]
+ at java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:811) ~[?:1.8.0_292]
+ at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:488) ~[?:1.8.0_292]
+ at java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:1990) ~[?:1.8.0_292]
+ at org.apache.flink.client.deployment.application.ApplicationDispatcherBootstrap.runApplicationEntryPoint(ApplicationDispatcherBootstrap.java:257) ~[flink-dist_2.12-1.13.1.jar:1.13.1]
+ at org.apache.flink.client.deployment.application.ApplicationDispatcherBootstrap.lambda$runApplicationAsync$1(ApplicationDispatcherBootstrap.java:212) ~[flink-dist_2.12-1.13.1.jar:1.13.1]
+ at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_292]
+ at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_292]
+ at org.apache.flink.runtime.concurrent.akka.ActorSystemScheduledExecutorAdapter$ScheduledFutureTask.run(ActorSystemScheduledExecutorAdapter.java:159) [flink-dist_2.12-1.13.1.jar:1.13.1]
+ at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:40) [flink-dist_2.12-1.13.1.jar:1.13.1]
+ at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:44) [flink-dist_2.12-1.13.1.jar:1.13.1]
+ at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) [flink-dist_2.12-1.13.1.jar:1.13.1]
+ at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) [flink-dist_2.12-1.13.1.jar:1.13.1]
+ at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) [flink-dist_2.12-1.13.1.jar:1.13.1]
+```
+
+
+```
+test
+test
+test
+``` \ No newline at end of file
diff --git a/layouts/404.html b/layouts/404.html
index bd70aeb..f4efc76 100644
--- a/layouts/404.html
+++ b/layouts/404.html
@@ -14,7 +14,6 @@
<div>{{ i18n "404subtitle" }}</div>
{{ end }}
</div>
- </div>
{{ with .Site.Params.readMore }}
<h2 class="read-more">{{ . }}</h2>
diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html
index 2a144d8..70ac35e 100644
--- a/layouts/_default/_markup/render-link.html
+++ b/layouts/_default/_markup/render-link.html
@@ -1,13 +1 @@
-<a
- href="{{ .Destination | safeURL }}"
- {{ with .Title}}
- title="{{ . }}"
- {{ end }}
-
- {{ if strings.HasPrefix .Destination "http" }}
- target="_blank"
- rel="noopener"
- {{ end }}
->
- {{ .Text | safeHTML }}
-</a> \ No newline at end of file
+<a href="{{ .Destination | safeURL }}"{{ with .Title}} title="{{ . }}" {{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank" rel="noopener"{{ end }}>{{ .Text | safeHTML }}</a> \ No newline at end of file
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 690d143..b6b48b7 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -23,8 +23,14 @@
</span>
</div>
+
+ {{ if or .Site.Params.showToc .Params.showToc }}
+ {{ partial "toc.html" . }}
+ {{ end }}
+
+
<div class="content">
- {{ .Content }}
+ {{ .Content }}
</div>
{{ with .Params.tags }}
diff --git a/layouts/index.html b/layouts/index.html
index 34bbc38..84fe663 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -15,7 +15,9 @@
</div>
</div>
- <div class="summary">{{ $summary | plainify | htmlUnescape }}</div>
+ {{ if ne .Site.Params.hiddenPostSummaryInHomePage true }}
+ <div class="summary">{{ $summary | plainify | htmlUnescape }}</div>
+ {{ end }}
</section>
{{ end }}
diff --git a/layouts/partials/comment.html b/layouts/partials/comment.html
index e6a398b..f7a16a8 100644
--- a/layouts/partials/comment.html
+++ b/layouts/partials/comment.html
@@ -1,4 +1,4 @@
-{{ if .Site.Params.enableComments }}
+{{ if or (and .Site.Params.enableComments (ne .Params.enableComments false)) (eq .Params.enableComments true) }}
<div id="comment">
<!-- https://gohugo.io/templates/internal/#use-the-disqus-template -->
{{ template "_internal/disqus.html" . }}
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index fd90325..833c955 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -3,7 +3,7 @@
{{ partial "social.html" . }}
{{ end }}
- <p class="copyright">
+ <div class="copyright">
{{ with .Site.Params.copyright }}
{{ . | markdownify }}
{{ else }}
@@ -14,8 +14,21 @@
</span>
{{ .Site.Params.Author }}
{{ end }}
- </p>
- <p class="powerby">
- {{ i18n "poweredby" | safeHTML }}
- </p>
+ </div>
+
+ {{ if ne .Site.Params.showPowerBy false }}
+ <div class="powerby">
+ Powered by <a href="http://www.gohugo.io/">Hugo</a> Theme By <a href="https://github.com/nodejh/hugo-theme-cactus-plus">nodejh</a>
+ </div>
+ {{ end }}
</footer>
+
+{{ range .Site.Params.customJS }}
+ {{ if ( or ( hasPrefix . "http://" ) ( hasPrefix . "https://" ) ) }}
+ <!-- remote js -->
+ <script src="{{ . }}"></script>
+ {{ else }}
+ <!-- local js -->
+ <script src="{{ $.Site.BaseURL }}{{ . }}"></script>
+ {{ end }}
+{{ end }}
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 277b8c7..43cc32e 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -11,17 +11,30 @@
{{ end }}
<link rel="stylesheet" href="{{ "/css/style.css" | relURL }}">
+
+{{ range .Site.Params.customCSS }}
+ {{ if ( or ( hasPrefix . "http://" ) ( hasPrefix . "https://" ) ) }}
+ <!-- remote css -->
+ <link rel="stylesheet" href="{{ . }}">
+ {{ else }}
+ <!-- local css -->
+ <link rel="stylesheet" href="{{ $.Site.BaseURL }}{{ . }}">
+ {{ end }}
+{{ end }}
+
<link rel="shortcut icon" href="{{ "/images/favicon.ico" | relURL }}" type="image/x-icon" />
{{ if .Site.Params.enableGoogleAnalytics }}
{{ template "_internal/google_analytics_async.html" . }}
{{ end }}
+{{ if or .Params.math .Site.Params.math }}
+ {{ partial "math.html" . }}
+{{ end }}
{{ if .OutputFormats.Get "RSS" }}
{{ with .OutputFormats.Get "RSS" }}
<link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml" title="{{ $.Site.Title }}" />
<link href="{{ .RelPermalink }}" rel="feed" type="application/rss+xml" title="{{ $.Site.Title }}" />
{{ end }}
-{{ end }}
-
+{{ end }} \ No newline at end of file
diff --git a/layouts/partials/math.html b/layouts/partials/math.html
new file mode 100644
index 0000000..7c1279a
--- /dev/null
+++ b/layouts/partials/math.html
@@ -0,0 +1,5 @@
+<!-- https://katex.org/docs/autorender.html -->
+<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.13.13/dist/katex.min.css" integrity="sha384-RZU/ijkSsFbcmivfdRBQDtwuwVqK7GMOw6IMvKyeWL2K5UAlyp6WonmB8m7Jd0Hn" crossorigin="anonymous">
+<script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.13/dist/katex.min.js" integrity="sha384-pK1WpvzWVBQiP0/GjnvRxV4mOb0oxFuyRxJlk6vVw146n3egcN5C925NCP7a7BY8" crossorigin="anonymous"></script>
+<script defer src="https://cdn.jsdelivr.net/npm/katex@0.13.13/dist/contrib/auto-render.min.js" integrity="sha384-vZTG03m+2yp6N6BNi5iM4rW4oIwk5DfcNdFfxkk9ZWpDriOkXX8voJBFrAO7MpVl" crossorigin="anonymous"
+ onload="renderMathInElement(document.body);"></script> \ No newline at end of file
diff --git a/layouts/partials/social.html b/layouts/partials/social.html
index 62ba3bb..ebc9d66 100644
--- a/layouts/partials/social.html
+++ b/layouts/partials/social.html
@@ -1,7 +1,7 @@
<div id="social">
{{ range $key, $val := .Site.Social }}
- <a class="symbol" href="{{ $val }}" target="_blank">
+ <a class="symbol" href="{{ $val }}" rel="me" target="_blank">
{{ $svg := print "svgs/" $key ".svg" }}
{{ partial $svg (dict "fill" "#bbbbbb" "width" 28 "height" 28 ) }}
</a>
diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html
new file mode 100644
index 0000000..4f20f04
--- /dev/null
+++ b/layouts/partials/toc.html
@@ -0,0 +1,10 @@
+<aside class="toc">
+ <details>
+ <summary>
+ {{- i18n "toc" | default "Table of Contents" }}
+ </summary>
+ <div>
+ {{ .TableOfContents }}
+ </div>
+ </details>
+</aside> \ No newline at end of file
diff --git a/static/css/style.css b/static/css/style.css
index 96279bc..9c05c65 100644
--- a/static/css/style.css
+++ b/static/css/style.css
@@ -1,3 +1,7 @@
+html[theme='dark-mode'] {
+ filter: invert(1) hue-rotate(180deg);
+}
+
body {
line-height: 1;
font: normal 15px/1.5em 'Helvetica Neue', Helvetica, Arial, sans-serif;
@@ -83,8 +87,8 @@ p {
}
p,
pre {
- line-break: anywhere;
- word-break: break-all;
+ word-break: normal;
+ overflow-wrap: anywhere;
}
.markdown-image img {
max-width: 100%;
@@ -102,6 +106,7 @@ h4:hover a {
}
.highlight pre {
padding: 7px;
+ overflow-x: auto;
}
.highlight {
@@ -179,6 +184,29 @@ nav.navigation a.button {
}
}
+/* toc */
+.toc {
+ margin: auto;
+ background: #f8f8f8;
+ border-radius: 0;
+ padding: 10px 7px;
+ margin-top: 36px;
+}
+.toc details summary {
+ cursor: zoom-in;
+ margin-inline-start: 14px;
+ font-weight: 500;
+}
+.toc details[open] summary {
+ cursor: zoom-out;
+}
+.toc #TableOfContents {
+ margin-left: 10px;
+}
+.toc ul {
+ padding-inline-start: 24px;
+}
+
/* comment */
#comment {
margin-top: 64px;
@@ -257,7 +285,7 @@ nav.navigation a.button {
}
#list-page .item {
- margin: 48px 0 0 0;
+ margin: 12px 0;
}
#list-page .title {
@@ -290,6 +318,9 @@ nav.navigation a.button {
#list-page .summary {
color: #757575;
margin-top: 12px;
+ word-break: normal;
+ overflow-wrap: anywhere;
+ margin-bottom: 36px;
}
#list-page .cover {
@@ -500,4 +531,4 @@ nav.navigation a.button {
position: relative;
top: 1px;
color: #bbb;
-} \ No newline at end of file
+}