简体   繁体   中英

Jekyll Post Excerpt: How to remove the first paragraph

I know how to use to define the end of the excerpt, but I'd like to omit the first paragraph of the post as well.

How can this be done?

Thanks in advance all!

Just got into the same issue. I have a separate place for excerpt and below I want post without excerpt (because it was already displayed). What worked for me was:

<header>
  {{ page.excerpt }}
</header>

<article>
  {{ content | remove_first:page.excerpt }}
</article>

It has to be defined in the same layout you use for posts and posts only.

If I understand right you just want the first paragraph.

post.excerpt gets the first paragraph of your post. An alternative would be to create a variable in your markdown files and call it whenever you want.

eg

---
layout: post
title: Your title
post_description: A plugin to extend Swiper for easier JW Player integration.
---

and call {{ post.post_description }} in your lists.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM