mirror of
https://github.com/flysnow-org/maupassant-hugo.git
synced 2026-08-24 15:28:55 +00:00
support hugo summary,close #22
This commit is contained in:
@@ -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的评论系统,使用方便,不用翻墙即可评论。
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user