Skip to content

Commit

Permalink
Revamp index template.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudLigny committed Oct 27, 2017
1 parent fd041c8 commit eb959aa
Showing 1 changed file with 19 additions and 38 deletions.
57 changes: 19 additions & 38 deletions layouts/index.html.twig
Original file line number Diff line number Diff line change
@@ -1,48 +1,29 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us">
{% include 'include/head.html.twig' %}
<body>
<body>
{% include 'include/sidebar.html.twig' %}
<div class="content container">
<div class="posts">
{% if not site.paginate.disabled %}
{% for post in page.pagination.pages %}
<div class="content container">
<div class="posts">
{% for post in site.pages|filterBy('section', 'blog')|sortByDate|slice(0, 1) %}
<div class="post">
<h1 class="post-title">
<a href="{{ url(post) }}">{{ post.title }}</a>
</h1>
<span class="post-date">{{ post.date|date("j M Y") }}</span>
{{ post.content|excerpt }}
<h1 class="post-title"><a href="{{ url(post) }}">{{ post.title }}</a></h1>
<span class="post-date">{{ post.date|date("j M Y") }}</span>
{{ post.content|excerpt }}
<footer class="readmore">
<a href="{{ url(post) }}#more">Lire la suite ›</a>
</footer>
</div>
{% endfor %}
{% else %}
{% for post in site.pages|filterBy('section', 'blog')|sortByDate %}
{% if post.id != 'blog/index' %}
<div class="post">
<h1 class="post-title">
<a href="{{ url(post) }}">{{ post.title }}</a>
</h1>
<span class="post-date">{{ post.date|date("j M Y") }}</span>
{{ post.content|excerpt }}
</div>
{% endif %}
</div>
<div class="lastposts">
<h2>Recent posts</h2>
<ul>
{% for post in site.pages|filterBy('section', 'blog')|sortByDate|slice(0, 5) %}
<li><a href="{{ url(post) }}">{{ post.title }}</a></li>
{% endfor %}
{% endif %}
</div>
{% if not site.paginate.disabled %}
<div class="pagination">
{% if page.pagination.prev is defined %}
<a class="pagination-item newer" href="{{ url(page.pagination.prev) }}">Newer</a>
{% else %}
<span class="pagination-item newer">Newer</span>
{% endif %}
{% if page.pagination.next is defined %}
<a class="pagination-item older" href="{{ url(page.pagination.next) }}">Older</a>
{% else %}
<span class="pagination-item older">Older</span>
{% endif %}
</ul>
</div>
</div>
{% endif %}
</div>
</body>
</body>
</html>

0 comments on commit eb959aa

Please sign in to comment.