Add default values for config variables (#621)

This commit is contained in:
Gabriel 2020-04-24 01:18:23 +02:00 committed by GitHub
parent 4a708530d9
commit b03fb7311f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 46 additions and 30 deletions

View file

@ -19,7 +19,8 @@ use-site-title: true
</a>
<p class="post-meta">
Posted on {{ post.date | date: site.date_format }}
{% assign date_format = site.date_format | default: "%B %-d, %Y" %}
Posted on {{ post.date | date: date_format }}
</p>
<div class="post-entry-container">
@ -31,9 +32,10 @@ use-site-title: true
</div>
{% endif %}
<div class="post-entry">
{{ post.excerpt | strip_html | xml_escape | truncatewords: site.excerpt_length }}
{% 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 > site.excerpt_length %}
{% if post.content != post.excerpt or excerpt_word_count > excerpt_length %}
<a href="{{ post.url | relative_url }}" class="post-read-more">[Read&nbsp;More]</a>
{% endif %}
</div>