Skip to content

Make recent posts section dynamic #13

@diethardsteiner

Description

@diethardsteiner

First of all: Thanks for the great template!
I made a few small changes on my copy ... so I'd like to feed this back: This is how you can make the Recent Posts section dynamic:

  <div class="recent-posts">
  <h1>Recent Posts</h1>

    <ul class="homepage-posts most-recent">
    {% for post in site.posts limit:1 %}
    <li><span><h4><a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a>&nbsp;<span class="badge"><smaller>FRESH</smaller></span><time class="pull-right">{{ post.date | date: '%B %d, %Y' }}</h4></time></span></h4></span></li>
    {% endfor %}

    {% for post in site.posts offset:1 limit:4 %}
    <ul class="homepage-posts">
      <li><span><h4><a href="{{ site.baseurl }}{{ post.url }}">{{ post.title }}</a><time class="pull-right">{{ post.date | date: '%B %d, %Y'}}</h4></time></span></h4></span></li>
    </ul>
    {% endfor %}

    <ul>
      <a href="{{ site.baseurl }}/list.html">View More...</a>
    </ul>
  </div>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions