diff --git a/_config.yml b/_config.yml index 33a1c035e..d36064d79 100755 --- a/_config.yml +++ b/_config.yml @@ -16,6 +16,9 @@ rss: # Specify the date when the site was setup #since: 2015 +# Footer `powered-by` and `theme-info` copyright +copyright: true + # Canonical, set a canonical link tag in your hexo, you could use it for your SEO of blog. # See: https://support.google.com/webmasters/answer/139066 # Tips: Before you open this tag, remeber set up your URL in hexo _config.yml ( ex. url: http://yourdomain.com ) @@ -209,6 +212,8 @@ highlight_theme: normal # Automatically scroll page to section which is under <!-- more --> mark. scroll_to_more: true +# Automatically excerpt description in homepage as preamble text. +excerpt_description: true # Automatically Excerpt. Not recommand. # Please use <!-- more --> in the post to control excerpt accurately. diff --git a/layout/_macro/post.swig b/layout/_macro/post.swig index 717009d57..09db965c2 100644 --- a/layout/_macro/post.swig +++ b/layout/_macro/post.swig @@ -163,6 +163,13 @@ <span class="busuanzi-value" id="busuanzi_value_page_pv" ></span>{{ theme.busuanzi_count.page_pv_footer }} </span> {% endif %} + + {% if post.description and (not theme.excerpt_description or not is_index) %} + <div class="post-description"> + {{ post.description }} + </div> + {% endif %} + </div> </header> {% endif %} @@ -190,30 +197,35 @@ {% endif %} {% if is_index %} - {% if post.description %} + {% if post.description and theme.excerpt_description %} {{ post.description }} + <!--noindex--> <div class="post-more-link text-center"> <a class="btn" href="{{ url_for(post.path) }}"> {{ __('post.read_more') }} » </a> </div> + <!--/noindex--> {% elif post.excerpt %} {{ post.excerpt }} + <!--noindex--> <div class="post-more-link text-center"> <a class="btn" href="{{ url_for(post.path) }}{% if theme.scroll_to_more %}#more{% endif %}" rel="contents"> {{ __('post.read_more') }} » </a> </div> + <!--/noindex--> {% elif theme.auto_excerpt.enable %} {% set content = post.content | striptags %} {{ content.substring(0, theme.auto_excerpt.length) }} {% if content.length > theme.auto_excerpt.length %}...{% endif %} - + <!--noindex--> <div class="post-more-link text-center"> <a class="btn" href="{{ url_for(post.path) }}{% if theme.scroll_to_more %}#more{% endif %}" rel="contents"> {{ __('post.read_more') }} » </a> </div> + <!--/noindex--> {% else %} {% if post.type === 'picture' %} <a href="{{ url_for(post.path) }}">{{ post.content }}</a> diff --git a/layout/_partials/footer.swig b/layout/_partials/footer.swig index ccfb67259..aebc13907 100644 --- a/layout/_partials/footer.swig +++ b/layout/_partials/footer.swig @@ -8,6 +8,7 @@ <span class="author" itemprop="copyrightHolder">{{ config.author }}</span> </div> +{% if theme.copyright %} <div class="powered-by"> {{ __('footer.powered', '<a class="theme-link" href="https://hexo.io">Hexo</a>') }} </div> @@ -18,3 +19,4 @@ NexT.{{ theme.scheme }} </a> </div> +{% endif %}