diff --git a/README.md b/README.md
index 72d1be3..425f565 100644
--- a/README.md
+++ b/README.md
@@ -88,6 +88,12 @@ theme = "maupassant"
googleAnalytics = "GA ID"
```
+#### Disqus
+
+```toml
+disqusShortname = "yourdiscussshortname"
+```
+
## Contributing
All kinds of contributions (enhancements, new features, documentation & code improvements, issues & bugs reporting) are welcome.
diff --git a/README_Zh.md b/README_Zh.md
index 089acc7..36f3a78 100644
--- a/README_Zh.md
+++ b/README_Zh.md
@@ -21,8 +21,13 @@ Maupassant theme, ported to Hugo.
7. 自定义友情链接支持
8. 支持文章按年份日期进行归档
9. 支持GA分析统计
-10. 支持关键字SEO优化
+10. sitemap站点地图
11. 代码高亮
+12. 404错误页
+13. 支持关键字SEO优化
+14. Google站内搜索
+15. See Also 支持
+16. Disqus评论支持
## 下载安装
@@ -121,6 +126,16 @@ type: archives
`content/archives/index.md`表示在`content/archives/`目录下的`index.md`文件
+#### Disqus
+
+该支持主持Disqus评论,如果要启用Disqus,可以在`config.toml`里添加如下配置即可.
+
+```toml
+disqusShortname = "yourdiscussshortname"
+```
+
+替换成你自己的Disqus名字即可。
+
#### 禁止分类的名称转为小写
我们在写文章的时候,会给文章进行分类,比如Golang,但是默认情况下,Hugo会把这个Golang转为小写,
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index b3b2f64..697d94d 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -28,6 +28,8 @@
{{ .Content }}
+ {{ partial "related" . }}
+
{{ if and (isset .Params "tags") .Params.tags }}
@@ -39,16 +41,6 @@
没有标签
{{ end }}
- {{ if eq .Type "post" }}
-
- {{if .NextInSection}}
-
{{.NextInSection.Title}}
- {{end}}
- {{if .PrevInSection}}
-
{{.PrevInSection.Title}}
- {{end}}
-
- {{ end }}
{{ partial "comments" . }}
diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html
index e69de29..393568b 100644
--- a/layouts/partials/comments.html
+++ b/layouts/partials/comments.html
@@ -0,0 +1 @@
+{{ template "_internal/disqus.html" . }}
\ No newline at end of file
diff --git a/layouts/partials/related.html b/layouts/partials/related.html
new file mode 100644
index 0000000..d226058
--- /dev/null
+++ b/layouts/partials/related.html
@@ -0,0 +1,11 @@
+{{ $related := .Site.RegularPages.Related . | first 5 }}
+{{ with $related }}
+
+{{ end }}
\ No newline at end of file
diff --git a/static/css/prism.css b/static/css/prism.css
index 0697a73..b9d49f7 100644
--- a/static/css/prism.css
+++ b/static/css/prism.css
@@ -1,5 +1,5 @@
/* PrismJS 1.15.0
-https://prismjs.com/download.html#themes=prism-coy&languages=markup+css+clike+javascript+c+bash+cpp+coffeescript+ruby+diff+docker+markup-templating+erlang+git+go+groovy+less+haskell+java+json+kotlin+markdown+lua+makefile+nginx+objectivec+php+python+r+swift+yaml+vim&plugins=line-numbers+highlight-keywords */
+https://prismjs.com/download.html#themes=prism-coy&languages=markup+css+clike+javascript+c+csharp+bash+basic+cpp+coffeescript+clojure+ruby+diff+docker+markup-templating+erlang+git+go+groovy+less+haskell+java+json+kotlin+markdown+lua+makefile+nginx+objectivec+perl+php+php-extras+sql+python+r+jsx+typescript+rust+scala+plsql+swift+yaml+tsx+vbnet+vim&plugins=highlight-keywords */
/**
* prism.js Coy theme for JavaScript, CoffeeScript, CSS and HTML
* Based on https://github.com/tshedor/workshop-wp-theme (Example: http://workshop.kansan.com/category/sessions/basics or http://workshop.timshedor.com/category/sessions/basics);
@@ -226,45 +226,3 @@ pre .line-highlight {
margin-top: 0;
}
-pre[class*="language-"].line-numbers {
- position: relative;
- padding-left: 3.8em;
- counter-reset: linenumber;
-}
-
-pre[class*="language-"].line-numbers > code {
- position: relative;
- white-space: inherit;
-}
-
-.line-numbers .line-numbers-rows {
- position: absolute;
- pointer-events: none;
- top: 0;
- font-size: 100%;
- left: -3.8em;
- width: 3em; /* works for line-numbers below 1000 lines */
- letter-spacing: -1px;
- border-right: 1px solid #999;
-
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
-
-}
-
- .line-numbers-rows > span {
- pointer-events: none;
- display: block;
- counter-increment: linenumber;
- }
-
- .line-numbers-rows > span:before {
- content: counter(linenumber);
- color: #999;
- display: block;
- padding-right: 0.8em;
- text-align: right;
- }
-
diff --git a/static/css/style.css b/static/css/style.css
index 5a3f2ed..6dd35fd 100644
--- a/static/css/style.css
+++ b/static/css/style.css
@@ -368,11 +368,11 @@ textarea {
.post-content h3,.post-content h2{
margin: 1.4em 0 1.1em;
}
-.post-content pre, .comment-content pre {
+/* .post-content pre, .comment-content pre {
max-height: 320px;
-}
+} */
.post-content pre, .comment-content pre {
- padding: 1.5em 2em;
+ padding: 1em 1.5em;
}
.post-content p code, .comment-content p code {
display:inline;
@@ -897,42 +897,6 @@ img.alignright {
display: block;
}
-/* post navigator*/
-.post-nav {
- overflow: hidden;
- margin-top: 15px;
- margin-bottom: 20px;
- padding: 10px;
- white-space: nowrap;
- border-top: 1px solid #eee;
-}
-.post-nav a {
- display: inline-block;
- line-height: 25px;
- font-size: 15px;
- color: #555;
- border-bottom: none;
- float: left;
-}
-.post-nav a.pre {
- float: left;
-}
-.post-nav a.pre:before {
- content: "\ea23";
- padding-right: 0.3em;
-}
-.post-nav a.next {
- float: right;
-}
-.post-nav a.next:after {
- content: "\ea24";
- padding-left: 0.3em;
-}
-.post-nav a:hover {
- border-bottom: none;
- color: #222;
-}
-
/* for archive page starts*/
.post-archive {
font-size: 15px;
diff --git a/static/js/prism.js b/static/js/prism.js
index d0a47de..c575564 100644
--- a/static/js/prism.js
+++ b/static/js/prism.js
@@ -1,14 +1,17 @@
/* PrismJS 1.15.0
-https://prismjs.com/download.html#themes=prism-coy&languages=markup+css+clike+javascript+c+bash+cpp+coffeescript+ruby+diff+docker+markup-templating+erlang+git+go+groovy+less+haskell+java+json+kotlin+markdown+lua+makefile+nginx+objectivec+php+python+r+swift+yaml+vim&plugins=line-numbers+highlight-keywords */
+https://prismjs.com/download.html#themes=prism-coy&languages=markup+css+clike+javascript+c+csharp+bash+basic+cpp+coffeescript+clojure+ruby+diff+docker+markup-templating+erlang+git+go+groovy+less+haskell+java+json+kotlin+markdown+lua+makefile+nginx+objectivec+perl+php+php-extras+sql+python+r+jsx+typescript+rust+scala+plsql+swift+yaml+tsx+vbnet+vim&plugins=highlight-keywords */
var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\blang(?:uage)?-([\w-]+)\b/i,t=0,n=_self.Prism={manual:_self.Prism&&_self.Prism.manual,disableWorkerMessageHandler:_self.Prism&&_self.Prism.disableWorkerMessageHandler,util:{encode:function(e){return e instanceof r?new r(e.type,n.util.encode(e.content),e.alias):"Array"===n.util.type(e)?e.map(n.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(!(w instanceof s)){if(m&&b!=t.length-1){h.lastIndex=k;var _=h.exec(e);if(!_)break;for(var j=_.index+(d?_[1].length:0),P=_.index+_[0].length,A=b,x=k,O=t.length;O>A&&(P>x||!t[A].type&&!t[A-1].greedy);++A)x+=t[A].length,j>=x&&(++b,k=x);if(t[b]instanceof s)continue;I=A-b,w=e.slice(k,x),_.index-=k}else{h.lastIndex=0;var _=h.exec(w),I=1}if(_){d&&(p=_[1]?_[1].length:0);var j=_.index+p,_=_[0].slice(p),P=j+_.length,N=w.slice(0,j),S=w.slice(P),C=[b,I];N&&(++b,k+=N.length,C.push(N));var E=new s(u,f?n.tokenize(_,f):_,y,_,m);if(C.push(E),S&&C.push(S),Array.prototype.splice.apply(t,C),1!=I&&n.matchGrammar(e,t,r,b,k,!0,u),i)break}else if(i)break}}}}},tokenize:function(e,t){var r=[e],a=t.rest;if(a){for(var l in a)t[l]=a[l];delete t.rest}return n.matchGrammar(e,r,t,0,0,!1),r},hooks:{all:{},add:function(e,t){var r=n.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){var r=n.hooks.all[e];if(r&&r.length)for(var a,l=0;a=r[l++];)a(t)}}},r=n.Token=function(e,t,n,r,a){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length,this.greedy=!!a};if(r.stringify=function(e,t,a){if("string"==typeof e)return e;if("Array"===n.util.type(e))return e.map(function(n){return r.stringify(n,t,e)}).join("");var l={type:e.type,content:r.stringify(e.content,t,a),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:a};if(e.alias){var i="Array"===n.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(l.classes,i)}n.hooks.run("wrap",l);var o=Object.keys(l.attributes).map(function(e){return e+'="'+(l.attributes[e]||"").replace(/"/g,""")+'"'}).join(" ");return"<"+l.tag+' class="'+l.classes.join(" ")+'"'+(o?" "+o:"")+">"+l.content+""+l.tag+">"},!_self.document)return _self.addEventListener?(n.disableWorkerMessageHandler||_self.addEventListener("message",function(e){var t=JSON.parse(e.data),r=t.language,a=t.code,l=t.immediateClose;_self.postMessage(n.highlight(a,n.languages[r],r)),l&&_self.close()},!1),_self.Prism):_self.Prism;var a=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return a&&(n.filename=a.src,n.manual||a.hasAttribute("data-manual")||("loading"!==document.readyState?window.requestAnimationFrame?window.requestAnimationFrame(n.highlightAll):window.setTimeout(n.highlightAll,16):document.addEventListener("DOMContentLoaded",n.highlightAll))),_self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism);
Prism.languages.markup={comment://,prolog:/<\?[\s\S]+?\?>/,doctype://i,cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+)/i,inside:{punctuation:[/^=/,{pattern:/(^|[^\\])["']/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/?[\da-z]{1,8};/i},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))}),Prism.languages.xml=Prism.languages.markup,Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup;
Prism.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(?:;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^{}\s][^{};]*?(?=\s*\{)/,string:{pattern:/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},property:/[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,important:/\B!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},Prism.languages.css.atrule.inside.rest=Prism.languages.css,Prism.languages.markup&&(Prism.languages.insertBefore("markup","tag",{style:{pattern:/(