File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,10 @@ url-pretty: "MyWebsite.com" # eg. "deanattali.com/beautiful-jekyll"
9090# Facebook App ID
9191# fb_app_id: ""
9292
93+ # Excerpt Word Length
94+ # Truncates the excerpt to the specified number of words on the index page
95+ excerpt_length : 50
96+
9397# --- Don't need to touch anything below here (but you can if you want) --- #
9498
9599# Output options (more information on Jekyll's site)
Original file line number Diff line number Diff line change @@ -22,19 +22,16 @@ <h3 class="post-subtitle">
2222 </ p >
2323
2424 < div class ="post-entry ">
25- {% assign cleaned_content = post.excerpt | strip_html | xml_escape %}
26- {% assign truncated_content = cleaned_content | truncatewords: 50 %}
27- {% if truncated_content == cleaned_content %}
28- {{ cleaned_content }}
29- {% else %}
30- {{ truncated_content }}
25+ {{ post.excerpt | strip_html | xml_escape | truncatewords: site.excerpt_length }}
26+ {% assign excerpt_word_count = post.excerpt | number_of_words %}
27+ {% if post.content != post.excerpt or excerpt_word_count > site.excerpt_length %}
3128 < a href ="{{ post.url | prepend: site.baseurl }} " class ="post-read-more "> [Read More]</ a >
32- {% endif%}
29+ {% endif %}
3330 </ div >
3431
3532 {% if post.tags.size > 0 %}
3633 < div class ="blog-tags ">
37- Tags:
34+ Tags:
3835 {% if site.link-tags %}
3936 {% for tag in post.tags %}
4037 < a href ="{{ site.baseurl }}/tag/{{ tag }} "> {{ tag }}</ a >
You can’t perform that action at this time.
0 commit comments