nielsenramon / chalk

Chalk is a high quality, completely customizable, performant and 100% free Jekyll blog theme.
http://chalk.nielsenramon.com
MIT License
1.23k stars 442 forks source link

Excerpt functionality #134

Closed cmakara closed 6 years ago

cmakara commented 6 years ago

With this addition it is possible the use the first part of the post dynamically instead of using a static description, which is more flexible.

nielsenramon commented 6 years ago

@cmakara Thanks for your PR! I don't the the fact that this is very random tho. It shows pictures as well and if you don't pay enough attention it will be very weird to read. Look at the example for Chalk:

screen shot 2018-01-05 at 11 18 49

What does everyone else think?

cmakara commented 6 years ago

I wanted to keep the description solution intact and as a higher priority, so if someone would not want to use customisable excerpts they do not have to.

The use case I wanted to solve with this that I wanted to write posts which describes at the front what it will be about. Because of this, using the description, I had to duplicate content into the description field in md files. But with the excerpt separator, the first customisable amount of the post would be serving as the description.

The intended way to use it is something like this:

---
layout: post
title: Something
excerpt_separator: <!--more-->
---

Some part of the post, which can be the description as well.

<!--more-->

... rest of the post.
nielsenramon commented 6 years ago

@cmakara Actually a good point. Can you also add this to the articles_by_tag page please? And you can probably just use a regular else?

I'll probably add some documentation about this.

cmakara commented 6 years ago

@nielsenramon I did add it to the articles_by_tag page.