How do I display most recent blog post on Octorpess/Jekyll landing page -
i created landing page octopress website , i'd have recent blog post displayed on home page, recent blog. not sure quite how proceed. there code {% include post %}
allow me this?
thanks.
as per usual, tend find solution after ask it.
on home page:
<div class="blog-index"> {% assign post = site.posts.first %} {% assign content = post.content %} {% include custom/asides/recent_post.html %} </div>
in separate document saved custom/asides/recent_post.html
:
<h2 class="entry-title"> {% if post.title %} <a href="{{ root_url }}{{ post.url }}" id="recent_post">{{ post.title }}</a> {% endif %} </h2> <div class="entry-content">{{ content | excerpt }}</div> <a class="btn btn-default" href="{{ root_url }}{{ post.url }}">{{ site.excerpt_link }}</a>
found solution here: https://gist.github.com/nimbupani/1421828
Comments
Post a Comment