Build a beautiful and simple website in literally minutes. Demo at http://deanattali.com/beautiful-jekyll

index.html 2.0KB

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