Add check to only show readme link when there is additional post content not shown on index page. Handles truncate words problems with Chinese and Japanese characters by checking for a manual break using the site excerpt separator. (#110)
This commit is contained in:
parent
d614580743
commit
1b668a3223
@ -81,6 +81,8 @@ share-links-active:
|
||||
url-pretty: "MyWebsite.com" # eg. "deanattali.com/beautiful-jekyll"
|
||||
|
||||
# --- Misc --- #
|
||||
# Manually break the site excerpt
|
||||
excerpt_separator: <!--read more-->
|
||||
|
||||
# Fill in your Disqus shortname (NOT the userid) if you want to support Disqus comments
|
||||
#disqus: ""
|
||||
|
15
index.html
15
index.html
@ -22,8 +22,19 @@ subtitle: This is where I will tell my friends way too much about me
|
||||
</p>
|
||||
|
||||
<div class="post-entry">
|
||||
{{ post.excerpt | strip_html | xml_escape | truncatewords: 50 }}
|
||||
<a href="{{ post.url | prepend: site.baseurl }}" class="post-read-more">[Read More]</a>
|
||||
{% if post.content contains site.excerpt_separator %}
|
||||
{{ post.excerpt | strip_html | xml_escape }}
|
||||
<a href="{{ post.url | prepend: site.baseurl }}" class="post-read-more">[Read More]</a>
|
||||
{% else %}
|
||||
{% assign cleaned_content = post.content | strip_html | xml_escape %}
|
||||
{% assign truncated_content = cleaned_content | truncatewords: 50 %}
|
||||
{% if truncated_content == cleaned_content %}
|
||||
{{ cleaned_content }}
|
||||
{% else %}
|
||||
{{ truncated_content }}
|
||||
<a href="{{ post.url | prepend: site.baseurl }}" class="post-read-more">[Read More]</a>
|
||||
{% endif%}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if post.tags.size > 0 %}
|
||||
|
Loading…
Reference in New Issue
Block a user