le code source de mon blog Sous les Ondes, basé sur Jekyll avec le thème Leonids https://souslesondes.fr

archive.html 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. ---
  2. layout: page
  3. title: Archives
  4. permalink: /archives/
  5. ---
  6. <div class="archive">
  7. <div class="timeline" id="timeline">
  8. {% for post in site.posts %}
  9. {% unless post.next %}
  10. <div class="archive-title">
  11. <h4 class="archive-year">{{ post.date | date: '%Y' }}</h4>
  12. </div>
  13. <ul>
  14. {% else %}
  15. {% capture year %}{{ post.date | date: '%Y' }}{% endcapture %}
  16. {% capture nyear %}{{ post.next.date | date: '%Y' }}{% endcapture %}
  17. {% if year != nyear %}
  18. </ul>
  19. <div class="archive-title">
  20. <h4 class="archive-year">{{ post.date | date: '%Y' }}</h4>
  21. </div>
  22. <ul>
  23. {% endif %}
  24. {% endunless %}
  25. <li>
  26. {% capture i18n_date %}
  27. {% assign day = post.date | date: "%-d" %}
  28. {% assign m = post.date | date: "%-m" | minus: 1 %}
  29. {% assign month = site.months[m] %}
  30. {% assign year = post.date | date: "%Y" %}
  31. {% assign datum = day | append: " " | append: month %}
  32. {% endcapture %}
  33. <div style="text-align:right;width:100px;float:left;padding-right:5px">{{ datum }}</div>
  34. <a href="{{ site.url }}{{ post.url }}"> {{ post.title }}</a></li>
  35. {% endfor %}
  36. </ul>
  37. </div>
  38. </div>