index.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. ---
  2. layout: page
  3. title: Blog
  4. description: "News and updates related to Start Bootstrap and articles showcasing content and ideas related to the Bootstrap framework"
  5. meta-title: "Blog"
  6. meta-description: "Start Bootstrap's official blog and article library. A great place to find Bootstrap tips and the latest updates to Start Bootstrap!"
  7. redirect_from:
  8. - /articles/
  9. - /articles/index.html
  10. - /articles/page2/
  11. - /articles/page3/
  12. - /articles/page4/
  13. ---
  14. <div class="container">
  15. <div class="row">
  16. <div class="col-lg-8">
  17. {% for post in paginator.posts %}
  18. <div class="card border-0 shadow mb-5">
  19. <div class="card-body p-5 pl-md-0 pr-md-5 py-md-5">
  20. <div class="row no-gutters">
  21. <!-- Post Image -->
  22. <div class="col-4 d-none d-md-flex align-items-center justify-content-center">
  23. {% if post.preview-image %}
  24. <img class="rounded img-fluid" style="width: 7.5rem; height: 7.5rem;" src="{{ post.preview-image }}">
  25. {% else %}
  26. <img class="img-fluid" style="width: 7.5rem; height: 7.5rem;" src="/assets/img/sb-logo.svg">
  27. {% endif %}
  28. </div>
  29. <!-- Post Content Preview -->
  30. <div class="col-12 col-md-8">
  31. <h4 class="card-title mb-1">
  32. <a href="{{ post.url }}">{{ post.title }}</a>
  33. </h4>
  34. <div class="small text-muted mb-3">{{ post.date | date: "%b %-d, %Y" }}</div>
  35. <!-- <div class="author text-muted mb-3">by
  36. {{ post.author }}
  37. </div> -->
  38. <p class="mb-4">{{ post.excerpt | strip_html | truncatewords: 30 }}</p>
  39. <a href="{{ post.url }}" class="btn btn-sm btn-primary">Read Post →</a>
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. {% endfor %}
  45. <!-- Show paginator for the specificed collection -->
  46. {% if paginator.total_pages > 1 %}
  47. <div class="col-12">
  48. <nav class="d-flex justify-content-center">
  49. <ul class="pagination d-inline-flex mb-5">
  50. {% if paginator.previous_page %}
  51. <li class="page-item">
  52. <a class="page-link" href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">
  53. <i class="fal fa-angle-left"></i>
  54. </a>
  55. </li>
  56. {% else %}
  57. <li class="page-item disabled">
  58. <a class="page-link" href="#">
  59. <i class="fal fa-angle-left"></i>
  60. </a>
  61. </li>
  62. {% endif %}
  63. {% for page in (1..paginator.total_pages) %}
  64. {% if page == paginator.page %}
  65. <li class="page-item disabled">
  66. <a class="page-link" href="#">{{ page }}</a>
  67. </li>
  68. {% elsif page == 1 %}
  69. <li class="page-item">
  70. <a class="page-link" href="/blog">
  71. {{ page }}
  72. </a>
  73. </li>
  74. {% else %}
  75. <li class="page-item">
  76. <a class="page-link" href="{{ site.paginate_path | relative_url | replace: ':num', page }}">
  77. {{ page }}
  78. </a>
  79. </li>
  80. {% endif %}
  81. {% endfor %}
  82. {% if paginator.page_trail %}
  83. {% for trail in paginator.page_trail %}
  84. <li {% if page.url==trail.path %}class="page-item active" {% else %}class="page-item" {% endif %}>
  85. <a class="page-link" href="{{ trail.path | prepend: site.baseurl | replace: 'index.html', '' }}">{{ trail.num }}</a>
  86. </li>
  87. {% endfor %}
  88. {% endif %}
  89. {% if paginator.next_page %}
  90. <li class="page-item">
  91. <a class="page-link" href="{{ paginator.next_page_path | prepend: site.baseurl | replace: '//', '/' }}">
  92. <i class="fal fa-angle-right"></i>
  93. </a>
  94. </li>
  95. {% else %}
  96. <li class="page-item disabled">
  97. <a class="page-link" href="#">
  98. <i class="fal fa-angle-right"></i>
  99. </a>
  100. </li>
  101. {% endif %}
  102. <!-- {% if paginator.last_page %}
  103. <li class="page-item">
  104. <a class="page-link" href="{{ paginator.last_page_path | prepend: site.baseurl | replace: '//', '/' }}">
  105. <i class="fal fa-angle-double-right"></i>
  106. </a>
  107. </li>
  108. {% endif %} -->
  109. </ul>
  110. </nav>
  111. </div>
  112. {% endif %}
  113. </div>
  114. </div>
  115. </div>