add config option 'feed_show_excerpt
This commit is contained in:
parent
fcddc9e561
commit
7d784b37c8
5 changed files with 94 additions and 65 deletions
|
@ -9,6 +9,31 @@ layout: page
|
|||
<div class="posts-list">
|
||||
{% for post in posts %}
|
||||
<article class="post-preview">
|
||||
|
||||
{%- capture thumbnail -%}
|
||||
{% if post.thumbnail-img %}
|
||||
{{ post.thumbnail-img }}
|
||||
{% elsif post.cover-img %}
|
||||
{% if post.cover-img.first %}
|
||||
{{ post.cover-img[0].first.first }}
|
||||
{% else %}
|
||||
{{ post.cover-img }}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% endif %}
|
||||
{% endcapture %}
|
||||
{% assign thumbnail=thumbnail | strip %}
|
||||
|
||||
{% if site.feed_show_excerpt == false %}
|
||||
{% if thumbnail != "" %}
|
||||
<div class="post-image post-image-normal">
|
||||
<a href="{{ post.url | absolute_url }}" aria-label="Thumbnail">
|
||||
<img src="{{ thumbnail | absolute_url }}" alt="Post thumbnail">
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<a href="{{ post.url | absolute_url }}">
|
||||
<h2 class="post-title">{{ post.title }}</h2>
|
||||
|
||||
|
@ -24,36 +49,32 @@ layout: page
|
|||
Posted on {{ post.date | date: date_format }}
|
||||
</p>
|
||||
|
||||
<div class="post-entry-container">
|
||||
{%- capture thumbnail -%}
|
||||
{% if post.thumbnail-img %}
|
||||
{{ post.thumbnail-img }}
|
||||
{% elsif post.cover-img %}
|
||||
{% if post.cover-img.first %}
|
||||
{{ post.cover-img[0].first.first }}
|
||||
{% else %}
|
||||
{{ post.cover-img }}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% endif %}
|
||||
{% endcapture %}
|
||||
{% assign thumbnail=thumbnail | strip %}
|
||||
{% if thumbnail != "" %}
|
||||
<div class="post-image">
|
||||
<a href="{{ post.url | absolute_url }}" aria-label="Thumbnail">
|
||||
<img src="{{ thumbnail | absolute_url }}" alt="Post thumbnail">
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="post-entry">
|
||||
{% assign excerpt_length = site.excerpt_length | default: 50 %}
|
||||
{{ post.excerpt | strip_html | xml_escape | truncatewords: excerpt_length }}
|
||||
{% assign excerpt_word_count = post.excerpt | number_of_words %}
|
||||
{% if post.content != post.excerpt or excerpt_word_count > excerpt_length %}
|
||||
<a href="{{ post.url | absolute_url }}" class="post-read-more">[Read More]</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if thumbnail != "" %}
|
||||
<div class="post-image post-image-small">
|
||||
<a href="{{ post.url | absolute_url }}" aria-label="Thumbnail">
|
||||
<img src="{{ thumbnail | absolute_url }}" alt="Post thumbnail">
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% unless site.feed_show_excerpt == false %}
|
||||
{% if thumbnail != "" %}
|
||||
<div class="post-image post-image-short">
|
||||
<a href="{{ post.url | absolute_url }}" aria-label="Thumbnail">
|
||||
<img src="{{ thumbnail | absolute_url }}" alt="Post thumbnail">
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="post-entry">
|
||||
{% assign excerpt_length = site.excerpt_length | default: 50 %}
|
||||
{{ post.excerpt | strip_html | xml_escape | truncatewords: excerpt_length }}
|
||||
{% assign excerpt_word_count = post.excerpt | number_of_words %}
|
||||
{% if post.content != post.excerpt or excerpt_word_count > excerpt_length %}
|
||||
<a href="{{ post.url | absolute_url }}" class="post-read-more">[Read More]</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endunless %}
|
||||
|
||||
{% if post.tags.size > 0 %}
|
||||
<div class="blog-tags">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue