Created
December 2, 2011 05:00
-
-
Save nimbupani/1421828 to your computer and use it in GitHub Desktop.
Showing latest post on home page with Jekyll
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
--- | |
layout: default | |
--- | |
<div class="blog-index"> | |
{% assign post = site.posts.first %} | |
{% assign content = post.content %} | |
{% include post_detail.html %} | |
</div> |
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
<h1 class="entry-title"> | |
{% if page.title %} | |
<a href="{{ root_url }}{{ page.url }}">{{ page.title }}</a> | |
{% endif %} | |
{% if post.title %} | |
<a href="{{ root_url }}{{ post.url }}">{{ post.title }}</a> | |
{% endif %} | |
</h1> | |
<div class="entry-content">{{ content }}</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I just added this into _layouts/home.html . Works like a charm.