Last active
December 23, 2021 10:25
-
-
Save keithgreer/ad5b893a89679a949dcc4e419694ceb3 to your computer and use it in GitHub Desktop.
Jekyll - Generate latest posts in Liquid https://keithgreer.dev/jekyll-posts-loop-liquid-template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% for post in site.posts limit:1 %} | |
<h2><a href="{{ post.url }}">{{ post.title }}</a></h2> | |
{{ post.content | strip_html | truncatehtml | truncatewords: 40 }} | |
{% endfor %} | |
{% for post in site.posts offset:1 limit:4 %} | |
<h3><a href="{{ post.url }}">{{ post.title }}</a></h3> | |
{{ post.content | strip_html | truncatehtml | truncatewords: 20 }} | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment