aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--archetypes/default.md5
-rw-r--r--exampleSite/config.toml8
-rw-r--r--exampleSite/content/_index.md3
-rw-r--r--exampleSite/content/post/chinese-preview.md14
-rw-r--r--exampleSite/content/post/english-preview.md13
-rw-r--r--exampleSite/content/post/even-preview.md16
-rw-r--r--exampleSite/content/post/japanese-preview.md13
-rw-r--r--exampleSite/content/post/syntax-highlighting.md13
-rw-r--r--layouts/_default/baseof.html2
-rw-r--r--layouts/partials/post/copyright.html2
-rw-r--r--layouts/partials/post/reward.html2
-rw-r--r--layouts/partials/post/toc.html4
-rw-r--r--layouts/partials/scripts.html2
13 files changed, 50 insertions, 47 deletions
diff --git a/archetypes/default.md b/archetypes/default.md
index 3a35b2f..dd9dc12 100644
--- a/archetypes/default.md
+++ b/archetypes/default.md
@@ -9,11 +9,12 @@ tags: []
categories: []
author: ""
-# you can close something for this content if you open it in config.toml.
+# You can also close(false) or open(true) something for this content.
+# P.S. comment can only be closed
comment: false
toc: false
autoCollapseToc: false
-# you can define another contentCopyright. e.g. contentCopyright: "This is an another copyright."
+# You can also define another contentCopyright. e.g. contentCopyright: "This is another copyright."
contentCopyright: false
reward: false
mathjax: false
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index bdcf877..373a33c 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -60,13 +60,13 @@ copyright = "" # default: author.name ↓ # 默认为下面配
# show word count and read time ? # 是否显示字数统计与阅读时间
moreMeta = false
- # 一些全局开关,你可以在每一篇内容的 front matter 中单独关闭某些选项
- # Some global options, you can close something in front matter.
+ # 一些全局开关,你也可以在每一篇内容的 front matter 中针对单篇内容关闭或开启某些功能,在 archetypes/default.md 查看更多信息。
+ # Some global options, you can also close or open something in front matter for a single post, see more information from `archetypes/default.md`.
toc = true # 是否开启目录
- autoCollapseToc = true # Auto expand and collapse toc # 目录自动展开/折叠
+ autoCollapseToc = false # Auto expand and collapse toc # 目录自动展开/折叠
fancybox = true # see https://github.com/fancyapps/fancybox # 是否启用fancybox(图片可点击)
bootcdn = false # In china. @Deprecated: use [params.publicCDN] # 是否使用bootcdn(@Deprecated: 请使用[params.publicCDN])
- mathjax = true # see https://www.mathjax.org/ # 是否使用mathjax(数学公式)
+ mathjax = false # see https://www.mathjax.org/ # 是否使用mathjax(数学公式)
linkToMarkDown = false # if you config contentCopyright and hugo output .md files. # 是否在链接到markdown原始文件(如果你配置了下面的许可协议并允许hugo生成markdown文件)
contentCopyright = '<a rel="license noopener" href="https://creativecommons.org/licenses/by-nc-nd/4.0/" target="_blank">CC BY-NC-ND 4.0</a>'
diff --git a/exampleSite/content/_index.md b/exampleSite/content/_index.md
deleted file mode 100644
index 8acc5aa..0000000
--- a/exampleSite/content/_index.md
+++ /dev/null
@@ -1,3 +0,0 @@
----
-mathjax: false
----
diff --git a/exampleSite/content/post/chinese-preview.md b/exampleSite/content/post/chinese-preview.md
index 5371f9b..8694688 100644
--- a/exampleSite/content/post/chinese-preview.md
+++ b/exampleSite/content/post/chinese-preview.md
@@ -6,14 +6,16 @@ draft: false
tags: ["preview", "中文", "tag-1"]
categories: ["中文"]
author: "Wikipedia"
-# you can close something for this content if you open it in config.toml.
-comment: false
-# toc: false
-# reward: false
-mathjax: false
-# you can define another contentCopyright. e.g. contentCopyright: "This is an another copyright."
+# You can also close(false) or open(true) something for this content.
+# P.S. comment can only be closed
+# comment: false
+# toc: false
+# autoCollapseToc: false
+# You can also define another contentCopyright. e.g. contentCopyright: "This is another copyright."
contentCopyright: '<a rel="license noopener" href="https://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License" target="_blank">Creative Commons Attribution-ShareAlike License</a>'
+# reward: false
+# mathjax: false
---
>《长恨歌》是中国唐朝诗人白居易的一首长篇叙事诗。
diff --git a/exampleSite/content/post/english-preview.md b/exampleSite/content/post/english-preview.md
index 811cd6e..032f14f 100644
--- a/exampleSite/content/post/english-preview.md
+++ b/exampleSite/content/post/english-preview.md
@@ -7,14 +7,15 @@ tags: ["preview", "English", "tag-2"]
categories: ["English"]
author: "Michael Henderson"
-# you can close something for this content if you open it in config.toml.
-comment: false
+# You can also close(false) or open(true) something for this content.
+# P.S. comment can only be closed
+# comment: false
# toc: false
-# reward: false
-mathjax: false
-
-# you can define another contentCopyright. e.g. contentCopyright: "This is an another copyright."
+autoCollapseToc: true
+# You can also define another contentCopyright. e.g. contentCopyright: "This is another copyright."
contentCopyright: '<a href="https://github.com/gohugoio/hugoBasicExample" rel="noopener" target="_blank">See origin</a>'
+# reward: false
+# mathjax: false
---
## Introduction
diff --git a/exampleSite/content/post/even-preview.md b/exampleSite/content/post/even-preview.md
index ab826c9..98ea597 100644
--- a/exampleSite/content/post/even-preview.md
+++ b/exampleSite/content/post/even-preview.md
@@ -5,19 +5,19 @@ lastmod: 2017-08-23T18:03:09+08:00
draft: false
tags: ["preview", "Theme preview", "tag-3"]
categories: ["Theme preview", "category-2", "category-3"]
+author: '<a href="https://laozhu.me" rel="noopener" target="_blank">米老朱</a>'
weight: 10
-# you can close something for this content if you open it in config.toml.
-comment: false
+# You can also close(false) or open(true) something for this content.
+# P.S. comment can only be closed
+# comment: false
# toc: false
-autoCollapseToc: false
-# reward: false
-# mathjax: false
-
-# you can define another contentCopyright. e.g. contentCopyright: "This is an another copyright."
-author: '<a href="https://laozhu.me" rel="noopener" target="_blank">米老朱</a>'
+# autoCollapseToc: false
+# You can also define another contentCopyright. e.g. contentCopyright: "This is another copyright."
contentCopyright: '<a href="https://laozhu.me/post/hugo-nuo-post-preview/" rel="noopener" target="_blank">See origin</a>'
+# reward: false
+mathjax: true
---
> Copy from [《Hugo 主题 Nuo 文章样式预览》](https://laozhu.me/post/hugo-nuo-post-preview/)
diff --git a/exampleSite/content/post/japanese-preview.md b/exampleSite/content/post/japanese-preview.md
index 7f8473e..6625d8d 100644
--- a/exampleSite/content/post/japanese-preview.md
+++ b/exampleSite/content/post/japanese-preview.md
@@ -9,14 +9,15 @@ tags: ["preview", "日本語", "tag-4"]
categories: ["日本語"]
author: "Wikipedia"
-# you can close something for this content if you open it in config.toml.
-comment: false
+# You can also close(false) or open(true) something for this content.
+# P.S. comment can only be closed
+# comment: false
# toc: false
-# reward: false
-mathjax: false
-
-# you can define another contentCopyright. e.g. contentCopyright: "This is an another copyright."
+# autoCollapseToc: false
+# You can also define another contentCopyright. e.g. contentCopyright: "This is another copyright."
contentCopyright: '<a rel="license noopener" href="https://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License" target="_blank">Creative Commons Attribution-ShareAlike License</a>'
+# reward: false
+# mathjax: false
---
> 日本語の敬語体系は、一般に、大きく尊敬語・謙譲語・丁寧語に分類される。文化審議会国語分科会は、2007年2月に「敬語の指針」を答申し、これに丁重語および美化語を含めた5分類を示している。
diff --git a/exampleSite/content/post/syntax-highlighting.md b/exampleSite/content/post/syntax-highlighting.md
index 686ba08..e53d5c1 100644
--- a/exampleSite/content/post/syntax-highlighting.md
+++ b/exampleSite/content/post/syntax-highlighting.md
@@ -6,14 +6,15 @@ draft: false
tags: ["preview", "Syntax Highlighting", "tag-5"]
categories: ["Syntax Highlighting"]
-# you can close something for this content if you open it in config.toml.
-comment: false
+# You can also close(false) or open(true) something for this content.
+# P.S. comment can only be closed
+# comment: false
toc: false
-# reward: false
-mathjax: false
-
-# you can define another contentCopyright. e.g. contentCopyright: "This is an another copyright."
+# autoCollapseToc: false
+# You can also define another contentCopyright. e.g. contentCopyright: "This is another copyright."
# contentCopyright: false
+# reward: false
+# mathjax: false
---
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 11f33fc..60edd94 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -23,7 +23,7 @@
{{ block "content" . }}{{ end }}
</div>
{{ partial "comments.html" . }}
- </div>
+ </div>
</main>
<footer id="footer" class="footer">
diff --git a/layouts/partials/post/copyright.html b/layouts/partials/post/copyright.html
index cbaefb7..8a8a350 100644
--- a/layouts/partials/post/copyright.html
+++ b/layouts/partials/post/copyright.html
@@ -1,4 +1,4 @@
-{{ if and .Site.Params.contentCopyright (ne .Params.contentCopyright false) }}
+{{ if or .Params.contentCopyright (and .Site.Params.contentCopyright (ne .Params.contentCopyright false)) }}
{{ $lang := .Site.Data.even.default -}}
<div class="post-copyright">
<p class="copyright-item">
diff --git a/layouts/partials/post/reward.html b/layouts/partials/post/reward.html
index 7847454..35933ea 100644
--- a/layouts/partials/post/reward.html
+++ b/layouts/partials/post/reward.html
@@ -1,4 +1,4 @@
-{{ if and .Site.Params.reward.enable (ne .Params.reward false) }}
+{{ if or .Params.reward (and .Site.Params.reward.enable (ne .Params.reward false)) }}
<div class="post-reward">
{{- $lang := .Site.Data.even.default }}
<input type="checkbox" name="reward" id="reward" hidden />
diff --git a/layouts/partials/post/toc.html b/layouts/partials/post/toc.html
index 35e6da6..e5985c9 100644
--- a/layouts/partials/post/toc.html
+++ b/layouts/partials/post/toc.html
@@ -1,7 +1,7 @@
-{{ if and .Site.Params.toc (ne .Params.toc false) }}
+{{ if or .Params.toc (and .Site.Params.toc (ne .Params.toc false)) }}
<div class="post-toc" id="post-toc">
<h2 class="post-toc-title">{{ .Site.Data.even.default.posts.toc }}</h2>
- {{ $globalAutoCollapseToc := .Site.Params.autoCollapseToc | default true }}
+ {{ $globalAutoCollapseToc := .Site.Params.autoCollapseToc | default false }}
<div class="post-toc-content{{ if not (or .Params.autoCollapseToc (and $globalAutoCollapseToc (ne .Params.autoCollapseToc false))) }} always-active{{ end }}">
{{.TableOfContents}}
</div>
diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html
index 6d4b51b..841aaa0 100644
--- a/layouts/partials/scripts.html
+++ b/layouts/partials/scripts.html
@@ -15,7 +15,7 @@
{{- end }}
<script type="text/javascript" src="{{ "dist/even.min.js?v=2.7.0" | relURL }}"></script>
-{{- if and (and .Site.Params.mathjax (ne .Params.mathjax false)) (or .IsPage .IsHome) }}
+{{- if and (or .Params.mathjax (and .Site.Params.mathjax (ne .Params.mathjax false))) (or .IsPage .IsHome) }}
<script type="text/javascript">
window.MathJax = {
showProcessingMessages: false,