Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Posting everything except the excerpt in Jekyll

So far I've made a custom excerpt in my config.yml file: excerpt_separator: <!--more-->

When I write a post I'd like to show the excerpt on the listings page which works just fine. However, I'd like to know if it's possible, on the post page, to post everything that is not the excerpt.

Example article:

---
title: Lorem ipsum dolor
layout: post
---
Lorem ipsum dolor sit amet, consectetur adipiscing elit. 
Cras in malesuada ipsum. Vivamus sapien orci, vulputate vitae 
consectetur ut, ullamcorper nec quam. Aliquam erat volutpat.

<!--more-->

Cras lacinia vehicula gravida. Cras sem quam, tincidunt at fringilla
sed, venenatis quis mauris. Praesent sit amet arcu varius mi sodales ultrices. 

On the post page I'd only like to show the paragraph beginning with "Cras lacinia", not Lorem ipsum.

Is that possible in Jekyll? I've searched and searched and only found ways to customize the excerpt but not to remove it all together.

like image 832
Ellenbrook Avatar asked Aug 27 '14 12:08

Ellenbrook


Video Answer


1 Answers

Just replace the {{ content }} by a tag that removes the {{ post.excerpt }} from the {{ post.content }}

{{ post.content | remove: post.excerpt }}

This will print the content without the excerpt. Et hop !

like image 102
David Jacquel Avatar answered Sep 21 '22 21:09

David Jacquel