Skip to content

Commit

Permalink
allow customisation of homepage excerpt
Browse files Browse the repository at this point in the history
  • Loading branch information
chesterhow committed Apr 30, 2021
1 parent de5cd20 commit 8c6e7c6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 5 additions & 1 deletion _layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ <h1 class="catalogue-title">{{ post.title }}</h1>
<div class="catalogue-line"></div>

<p>
{{ post.content | strip_html | truncatewords: 30 }}
{% if post.excerpt_separator %}
{{ post.excerpt | strip_html }}
{% else %}
{{ post.content | strip_html | truncatewords: 30 }}
{% endif %}
</p>

</div>
Expand Down
3 changes: 2 additions & 1 deletion _posts/2017-03-16-example-content.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ layout: post
title: "Example Content"
author: "Chester"
tags: Example
excerpt_separator: <!--more-->
---

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas tincidunt ornare nibh, non elementum augue tempus eget. Pellentesque tempus scelerisque iaculis. Nullam interdum ultricies nibh quis sollicitudin. Donec ornare fermentum facilisis. Ut at sem ac sem imperdiet varius a eget tortor. Nam eu augue eget orci semper maximus in eget augue. Mauris ornare, nisl ut suscipit consectetur, mi quam interdum tellus, at rutrum quam eros ultrices mi.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas tincidunt ornare nibh, non elementum augue tempus eget. Pellentesque tempus scelerisque iaculis.<!--more--> Nullam interdum ultricies nibh quis sollicitudin. Donec ornare fermentum facilisis. Ut at sem ac sem imperdiet varius a eget tortor. Nam eu augue eget orci semper maximus in eget augue. Mauris ornare, nisl ut suscipit consectetur, mi quam interdum tellus, at rutrum quam eros ultrices mi.

# Headers
{% highlight markdown %}
Expand Down
3 changes: 2 additions & 1 deletion _posts/2017-03-29-introducing-tale.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ title: "Introducing Tale"
author: "Chester"
comments: true
tags: Tale
excerpt_separator: <!--more-->
---

Tale is a minimal [Jekyll](https://jekyllrb.com/) theme curated for storytellers. It is designed and developed by [myself](https://github.com/chesterhow/) for a friend who writes short stories.
Tale is a minimal [Jekyll](https://jekyllrb.com/) theme curated for storytellers. It is designed and developed by [myself](https://github.com/chesterhow/) for a friend who writes short stories.<!--more-->

## Tale features
- Compatible with GitHub Pages
Expand Down

0 comments on commit 8c6e7c6

Please sign in to comment.