index.html 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. {% extends "base.html" %}
  2. {% block content_title %}{% endblock %}
  3. {% block content %}
  4. {% if articles %}
  5. {% for article in articles_page.object_list %}
  6. {# First item #}
  7. {% if loop.first and not articles_page.has_previous() %}
  8. <aside id="featured" class="body">
  9. <article>
  10. <h1 class="entry-title"><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></h1>
  11. {% include 'article_infos.html' %}{{ article.content }}{% include 'comments.html' %}
  12. </article>
  13. </aside><!-- /#featured -->
  14. {% if loop.length > 1 %}
  15. <section id="content" class="body">
  16. <h1>Other articles</h1>
  17. <hr />
  18. <ol id="posts-list" class="hfeed">
  19. {% endif %}
  20. {# other items #}
  21. {% else %}
  22. {% if loop.first %}
  23. <section id="content" class="body">
  24. <ol id="posts-list" class="hfeed" start="{{ articles_paginator.per_page -1 }}">
  25. {% endif %}
  26. <li><article class="hentry">
  27. <header>
  28. <h1><a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark"
  29. title="Permalink to {{ article.title|striptags }}">{{ article.title }}</a></h1>
  30. </header>
  31. <div class="entry-content">
  32. {% include 'article_infos.html' %}
  33. {{ article.summary }}
  34. <a class="readmore" href="{{ SITEURL }}/{{ article.url }}">read more</a>
  35. {% include 'comments.html' %}
  36. </div><!-- /.entry-content -->
  37. </article></li>
  38. {% endif %}
  39. {% if loop.last %}
  40. {% if loop.length > 1 or articles_page.has_other_pages() %}
  41. </ol><!-- /#posts-list -->
  42. {% if articles_page.has_other_pages() %}
  43. {% include 'pagination.html' %}
  44. {% endif %}
  45. </section><!-- /#content -->
  46. {% endif %}
  47. {% endif %}
  48. {% endfor %}
  49. {% else %}
  50. <section id="content" class="body">
  51. <h2>Pages</h2>
  52. {% for page in pages %}
  53. <li><a href="{{ SITEURL }}/{{ page.url }}">{{ page.title }}</a></li>
  54. {% endfor %}
  55. </section>
  56. {% endif %}
  57. {% endblock content %}