浏览代码

Switch to Hugo's built-in Disqus template

digitalcraftsman 7 年前
父节点
当前提交
eab1974019
共有 2 个文件被更改,包括 5 次插入10 次删除
  1. 3
    8
      README.md
  2. 2
    2
      layouts/_default/single.html

+ 3
- 8
README.md 查看文件

@@ -119,19 +119,14 @@ params:
119 119
 
120 120
 ### Disqus
121 121
 
122
-You can optionally enable a comment system powered by Disqus for the posts. Simply add the variable `disqusShortname` to the `params` in your config file.
122
+You can optionally enable a comment system powered by Disqus for the posts. Simply add the variable `disqusShortname` to  your config file.
123 123
 
124 124
 **TOML**
125 125
 ```toml
126
-[params]
127
-  disqusShortname = "spf13"
126
+disqusShortname = "spf13"
128 127
 ```
129 128
 
130
-**YAML**
131
-```yaml
132
-params:
133
-  disqusShortname: "spf13"
134
-```
129
+> **Note:** Previous version 1.0 the Disqus shortname had to be defined inside the `[params]` block.
135 130
 
136 131
 ## Author
137 132
 **Mark Otto**

+ 2
- 2
layouts/_default/single.html 查看文件

@@ -5,8 +5,8 @@
5 5
   {{ .Content }}
6 6
 </div>
7 7
 
8
-{{ if .Site.Params.disqusShortname -}}
8
+{{ if .Site.DisqusShortname -}}
9 9
 <h2>Comments</h2>
10
-
10
+{{ template "_internal/disqus.html" . }}
11 11
 {{- end }}
12 12
 {{- end }}