recent_posts.html 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. {{ if isset .Site.Params "recent_posts" }}
  2. {{ if .Site.Params.recent_posts.enable }}
  3. <section class="bar background-white no-mb">
  4. <div class="container">
  5. <div class="col-md-12">
  6. <div class="heading text-center">
  7. <h2>{{ .Site.Params.recent_posts.title | markdownify }}</h2>
  8. </div>
  9. <p class="lead">
  10. {{ .Site.Params.recent_posts.subtitle | markdownify }}
  11. </p>
  12. <!-- *** BLOG HOMEPAGE *** -->
  13. <div class="row">
  14. {{ $posts := .Paginate (where site.RegularPages "Type" "in" site.Params.mainSections) }}
  15. {{ range first 4 $posts.Pages }}
  16. <div class="col-md-3 col-sm-6">
  17. <div class="box-image-text blog">
  18. <div class="top">
  19. <div class="image" style="overflow:hidden">
  20. {{ if isset .Params "banner" }}
  21. <img src="{{ .Params.banner | relURL }}" class="img-responsive" alt="" >
  22. {{ else }}
  23. <img src="{{ "img/placeholder.png" | relURL }}" class="img-responsive" alt="">
  24. {{ end }}
  25. </div>
  26. <div class="bg"></div>
  27. <div class="text">
  28. <p class="buttons">
  29. <a href="{{ .Permalink }}" class="btn btn-template-transparent-primary"><i class="fas fa-link"></i> {{ i18n "readMore" }}</a>
  30. </p>
  31. </div>
  32. </div>
  33. <div class="content">
  34. <h4><a href="{{ .Permalink }}">{{ .Title }}</a></h4>
  35. <p class="author-category">
  36. {{ with .Params.author }}
  37. {{ i18n "authorBy" }} <a href="#">{{ . }}</a>
  38. {{ end }}
  39. {{ i18n "publishedOn" }} {{ .Date.Format .Site.Params.date_format }}
  40. </p>
  41. <p class="intro">{{ .Summary }}</p>
  42. <p class="read-more">
  43. <a href="{{ .Permalink }}" class="btn btn-template-main">{{ i18n "continueReading" }}</a>
  44. </p>
  45. </div>
  46. </div>
  47. <!-- /.box-image-text -->
  48. </div>
  49. {{ end }}
  50. </div>
  51. <!-- /.row -->
  52. <!-- *** BLOG HOMEPAGE END *** -->
  53. </div>
  54. </div>
  55. <!-- /.container -->
  56. </section>
  57. <!-- /.bar -->
  58. {{ end }}
  59. {{ end }}