index.html 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. ---
  2. layout: page
  3. title:
  4. subtitle:
  5. use-site-title: false
  6. ---
  7. <div class="posts-list">
  8. {% for post in paginator.posts %}
  9. <article class="post-preview">
  10. <a href="{{ post.url | relative_url }}">
  11. <h2 class="post-title">{{ post.title }}</h2>
  12. {% if post.subtitle %}
  13. <h3 class="post-subtitle">
  14. {{ post.subtitle }}
  15. </h3>
  16. {% endif %}
  17. </a>
  18. <p class="post-meta">
  19. Posted on {{ post.date | date: site.date_format }}
  20. </p>
  21. <div class="post-entry-container">
  22. {% if post.image %}
  23. <div class="post-image">
  24. <a href="{{ post.url | relative_url }}">
  25. <img src="{{ post.image | relative_url }}">
  26. </a>
  27. </div>
  28. {% endif %}
  29. <div class="post-entry">
  30. {{ post.excerpt | strip_html | xml_escape | truncatewords: site.excerpt_length }}
  31. {% assign excerpt_word_count = post.excerpt | number_of_words %}
  32. {% if post.content != post.excerpt or excerpt_word_count > site.excerpt_length %}
  33. <a href="{{ post.url | relative_url }}" class="post-read-more">[Read&nbsp;More]</a>
  34. {% endif %}
  35. </div>
  36. </div>
  37. {% if post.tags.size > 0 %}
  38. <div class="blog-tags">
  39. Tags:
  40. {% if site.link-tags %}
  41. {% for tag in post.tags %}
  42. <a href="{{ '/tags' | relative_url }}#{{- tag -}}">{{- tag -}}</a>
  43. {% endfor %}
  44. {% else %}
  45. {{ post.tags | join: ", " }}
  46. {% endif %}
  47. </div>
  48. {% endif %}
  49. </article>
  50. {% endfor %}
  51. </div>
  52. {% if paginator.total_pages > 1 %}
  53. <ul class="pager main-pager">
  54. {% if paginator.previous_page %}
  55. <li class="previous">
  56. <a href="{{ paginator.previous_page_path | relative_url }}">&larr; Newer Posts</a>
  57. </li>
  58. {% endif %}
  59. {% if paginator.next_page %}
  60. <li class="next">
  61. <a href="{{ paginator.next_page_path | relative_url }}">Older Posts &rarr;</a>
  62. </li>
  63. {% endif %}
  64. </ul>
  65. {% endif %}