index.html 2.5 KB

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