提交 ebe85207 编写于 作者: EvanOne(文一)'s avatar EvanOne(文一)

refactor(#8): Not show read more when the post without excerpt

上级 9c06aa42
section#recent-posts.recent-posts
include ../_mixins/post-header.pug
include ../_mixins/gallery.pug
- var postLists = theme.post_list.paginate.home ? page.posts : site.posts
......@@ -13,6 +14,7 @@ section#recent-posts.recent-posts
if post.photos && post.photos.length
+gallery(post)
- var isExcerpt = true
if theme.auto_excerpt && theme.auto_excerpt.enable
- const content = strip_html(post.content)
- var excerpt = content.substring(0, theme.auto_excerpt.length)
......@@ -21,9 +23,10 @@ section#recent-posts.recent-posts
else if post.excerpt
div.post-excerpt!= post.excerpt
else
- isExcerpt = false
div.post-excerpt!= post.content
if !post.link
if !post.link && isExcerpt
div.post-btn
a(href=url_for(post.path))= _p("post.read_more") + " »"
- })
extends ./_common/layout.pug
block content
include ./_mixins/posts-sort.pug
include ./_mixins/post-header.pug
div.content.home-content.code-highlight
if theme.post_list.paginate.home
include ./_components/recent-posts.pug
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册