Skip to content

Commit 94bc45e

Browse files
committed
Add support for post excerpts
1 parent 11e728b commit 94bc45e

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
baseurl: /jekyll-theme-bootstrap4
2+
excerpts: true
23
exclude:
34
- "*.gemspec"
45
- "CONTRIBUTING*"

_includes/post.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
<h1 itemprop="headline"><a href="{{ include.post.url | relative_url }}">{{ include.post.title }}</a></h1>
33
<p>{% if include.post.author %}By <span itemprop="author">{{ include.post.author }}</span> on {% endif %}<time itemprop="datePublished" datetime="{{ include.post.date | date_to_xmlschema }}">{{ include.post.date | date: "%B %-d, %Y" }}</time>{% if include.post.comments %}. <a href="{{ include.post.url | relative_url }}#disqus_thread" data-disqus-identifier="{{ include.post.url | relative_url }}"></a>{% endif %}</p>
44
<div itemprop="articleBody">
5-
{{ include.post.content | markdownify }}
5+
{% if page.type == "home" and site.excerpts %}
6+
{{ include.post.excerpt | markdownify }}
7+
<p><a href="{{ post.url }}">Read more&hellip;</a></p>
8+
{% else %}
9+
{{ include.post.content | markdownify }}
10+
{% endif %}
611
</div>
712
<p>{% include post_tags.html post=include.post %}</p>
813
</article>

0 commit comments

Comments
 (0)