feat: excerpt_all

This commit is contained in:
shenyu 2020-02-12 12:50:12 +08:00
parent 200450fadd
commit 71bc221675
4 changed files with 12 additions and 4 deletions

View File

@ -103,6 +103,7 @@ progressBar: ture
# Article Setting # Article Setting
# (Use this to excerpt if article is too long<!--more-->) # (Use this to excerpt if article is too long<!--more-->)
excerpt_link: Read More... excerpt_link: Read More...
excerpt_all: false
# Share # Share
share_enable: true share_enable: true
@ -146,6 +147,7 @@ weixin: /images/wechat.jpg
copyright_type: 2 copyright_type: 2
# Search # Search
# https://github.com/theme-next/hexo-generator-searchdb
search: true search: true
# RSS # RSS

View File

@ -38,6 +38,8 @@ progressBar: ture
# 文章配置 # 文章配置
# 文章太长,截断按钮文字(在需要截断的行增加此标记:<!--more-->) # 文章太长,截断按钮文字(在需要截断的行增加此标记:<!--more-->)
excerpt_link: 阅读更多... excerpt_link: 阅读更多...
# 如果你嫌每篇文章手动加more标记比较麻烦又不想在首页全文显示可以把excerpt_all设置成true这样首页只会显示文章归档
excerpt_all: false
# 是否开启文章分享按钮 # 是否开启文章分享按钮
share_enable: true share_enable: true
@ -82,6 +84,7 @@ weixin: /images/wechat.jpg
copyright_type: 2 copyright_type: 2
# 是否启用搜索 # 是否启用搜索
# 需要安装hexo-generator-searchdb(https://github.com/theme-next/hexo-generator-searchdb)
search: true search: true
# RSS订阅(先安装hexo-generator-feed插件再去博客根目录config进行配置) # RSS订阅(先安装hexo-generator-feed插件再去博客根目录config进行配置)

View File

@ -22,6 +22,7 @@
<%- partial('post/tocbot') %> <%- partial('post/tocbot') %>
<% } %> <% } %>
<% if (!theme.excerpt_all){ %>
<div class="article-entry" itemprop="articleBody"> <div class="article-entry" itemprop="articleBody">
<%- partial('post/justifiedGallery') %> <%- partial('post/justifiedGallery') %>
<%- partial('post/gallery') %> <%- partial('post/gallery') %>
@ -40,6 +41,8 @@
</div> </div>
<% } %> <% } %>
</div> </div>
<% } %>
<!-- copyright --> <!-- copyright -->
<% if (((theme.copyright_type === 2) || (theme.copyright_type === 1 && post.copyright)) && !index){ %> <% if (((theme.copyright_type === 2) || (theme.copyright_type === 1 && post.copyright)) && !index){ %>
<div class="declare"> <div class="declare">

View File

@ -3,10 +3,8 @@
padding 4.5rem 0 padding 4.5rem 0
&:not(:last-child) &:not(:last-child)
border-bottom border-width #ddd solid border-bottom border-width #ddd solid
.article-entry, .article-footer
margin-top 0
.article-entry .article-entry
margin 1rem 0 margin-top 1rem
padding 0 2rem 2rem padding 0 2rem 2rem
border 1px dashed lighten(tag-color,80%) border 1px dashed lighten(tag-color,80%)
.article-more-link .article-more-link
@ -19,3 +17,5 @@
text-decoration none text-decoration none
.article-gallery .article-gallery
margin-top 1.5rem margin-top 1.5rem
.article-footer
margin-top 1rem