You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Awesome Blog Post
Here is an example post to show how to use the new `excerpt` tag.
The excerpt tag provides a quick and easy way to tease a post by exposing only the first paragraph such as on a blog index page.
Then in your template, you could create an index file like this:
<ul>
{% for post in site.posts %}
<li>
<a href="{% post.permalink %}">{% post.title %}</a>
<p>{{ post.excerpt }}</p>
</li>
{% endfor %}
</ul>
Which would produce:
Awesome Blog Post
Here is an example post to show how to use the new excerpt tag.
Remember to use in the actual post to tell Jekyll where it should 'cut' the post for the excerpt content. You can also set excerpt_separator globally in your _config.yml to whatever may tickle you fancy.
@vkatariya8 I have excerpt_separator: "<!--more-->" in my _config.yml. In the post, I then place an image then the first paragraph (the default excerpt) followed by <!--more-->.
Thanks @ahmadajmi
If you leave out "strip_html" a post image will show if it is before the truncate.
The following works as well. {{ post.excerpt | strip_html | truncatewords:75 }}
Awesome. I was wondering what would happen if an image was within the post.content excerpt area. I didn't want the image displayed, but only the text. Thanks for sharing! The strip_html did the trick.
I have specified excerpt_separator: <!--more--> in the _config.yml file and in front matter, but it doesn't matter where I put it <!–more–>.
Upon request {{ post.excerpt }} I get all content 🙃
Trying to figure out Jekyll. Getting this error when generating "Liquid Exception: Unknown tag 'post' in index.md"