support hugo summary,close #22

This commit is contained in:
飞雪无情
2018-12-29 11:13:23 +08:00
parent 31c78ef848
commit ce5e09263d
4 changed files with 21 additions and 2 deletions
+10
View File
@@ -36,6 +36,7 @@ Maupassant theme, ported to Hugo.
18. 自定义css、js
19. utteranc评论
20. 部分自定义的shortcode
21. 文章自定义摘要
## 下载安装
@@ -165,6 +166,15 @@ type: archives
disqusShortname = "yourdiscussshortname"
```
#### 自定义文章摘要
该主题采用了Hugo内置的摘要支持,大家可以通过`<!--more-->`自定义自己的摘要,也可以使用自动摘要,使用自动摘要时,可以在`config.toml`中设置摘要的长度
```toml
# 默认是70
summaryLength = 140
```
#### utteranc
该主题支持utteranc评论,这是一个基于Github Issue的评论系统,使用方便,不用翻墙即可评论。
+9
View File
@@ -107,6 +107,15 @@ Ads Preview [http://www.flysnow.org/](http://www.flysnow.org/)
googleAnalytics = "GA ID"
```
#### Custonm Summaries
Support Hugo Content Summaries `<!--more-->`。You can change summary length in `config.toml` config file.
```toml
# default is 70
summaryLength = 140
```
#### Disqus
```toml
+1 -1
View File
@@ -42,7 +42,7 @@
</div>
{{ end }}
<div class="post-content">
{{ .Content | markdownify | truncate 180 }}
{{ .Summary | markdownify }}……
<p class="readmore"><a href="{{ .Permalink }}">阅读全文</a></p>
</div>
</article>
+1 -1
View File
@@ -28,7 +28,7 @@
</div>
{{ end }}
<div class="post-content">
{{ .Content | markdownify | truncate 180 }}
{{ .Summary | markdownify }}……
</div>
<p class="readmore"><a href="{{ .Permalink }}">阅读全文</a></p>
</article>