Blog Excerpts: Can I exclude stuff?


#1

I’m checking to see if there’s an easy solution to my problem, before I go all gung-ho and try to learn Liquid and templates, etc.

Is there any way to exclude something from blog excerpts?

Short explanation: I’m hard-coding navigation links for certain blog posts, and I’d like them at the top of the post, but then they end up in Excerpt.

Is there an easy way to exclude them from Excerpt, before I start learning something new? (Because heaven forbid I should learn something new if I don’t have to.)

Thanks.


#2

Anything before the first pair of consecutive \n (newline character) is included in the excerpt.
For example, in the text below,

Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the
1500s, when an unknown printer took a galley of type and scrambled it to
make a type specimen book.

It has survived not only five centuries, but also
the leap into electronic typesetting, remaining essentially unchanged.

The first \n occurs right after book. and the next occurs immediately after that.
Anything after the two \n\n will be in the post’s body.

Alternatively, you can define a custom separator in the front matter:

---
excerpt_separator: "read more.."
---

#3

Thanks for the reply. excerpt_separator defines where the excerpt stops. I want to define where it should start. But since you said

“anything before … is included in the excerpt”

then I’m guessing I’m out of luck.

Thanks.


#4

try striphtml with excerpt


#5

Thanks. I decided to do it the “right” way and add the buttons I wanted at the top of the post using a new “layout”. Well, a copied layout with changes. So in the long run, it’s good this happened, because I learned something, no matter how hard I tried not to. :stuck_out_tongue: