news-all.html 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <h3 class="post-block-title">
  2. <span>More News</span>
  3. </h3>
  4. <div class="row news-all">
  5. {{ range $index, $element := (where site.RegularPages "Type" "post") | first 9 }}
  6. <div class="col-12 col-sm-6 col-lg-4 mb-3">
  7. <div class="row align-items-center">
  8. <div class="col-12">
  9. <a href="{{ .Permalink }}">
  10. <img class="img-fluid" src="{{ .Params.image | relURL }}" alt="" />
  11. </a>
  12. </div>
  13. <div class="col-12">
  14. <article>
  15. <section class="news-info">
  16. {{ range (.GetTerms "categories") }}
  17. <a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
  18. {{ end }}
  19. <small>{{ .Date | time.Format ":date_long" }}</small>
  20. </section>
  21. <h2 class="post-title">
  22. <a href="{{ .Params.url }}">{{ .Params.title }}</a>
  23. </h2>
  24. </article>
  25. </div>
  26. <!-- <span class="line">
  27. <hr>
  28. </span> -->
  29. </div>
  30. </div>
  31. {{ end }}
  32. </div>
  33. <!-- <h3 class="post-block-title">
  34. <span>More News</span>
  35. </h3>
  36. <div class="row news-all">
  37. {{ range $index, $element := (where site.RegularPages "Type" "post") | first 10 }}
  38. {{ if (eq $index 0) }}
  39. <div class="col-12">
  40. <article>
  41. <a href="{{ .Permalink }}">
  42. <img class="img-fluid first-img" src="{{ .Params.image | relURL }}" alt="" />
  43. </a>
  44. <section class="news-info">
  45. {{ range (.GetTerms "categories") }}
  46. <a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
  47. {{ end }}
  48. <small>{{ .Date | time.Format ":date_long" }}</small>
  49. </section>
  50. <h2 class="post-title">
  51. <a href="{{ .Params.url }}">{{ .Params.title }}</a>
  52. </h2>
  53. <hr>
  54. </article>
  55. </div>
  56. {{ else }}
  57. <div class="col-12">
  58. <div class="row align-items-center">
  59. <div class="col-12 col-sm-5">
  60. <a href="{{ .Permalink }}">
  61. <img class="img-fluid cover-img" src="{{ .Params.image | relURL }}" alt="" />
  62. </a>
  63. </div>
  64. <div class="col-12 col-sm-7">
  65. <article>
  66. <section class="news-info">
  67. {{ range (.GetTerms "categories") }}
  68. <a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
  69. {{ end }}
  70. <small>{{ .Date | time.Format ":date_long" }}</small>
  71. </section>
  72. <h2 class="post-title">
  73. <a href="{{ .Params.url }}">{{ .Params.title }}</a>
  74. </h2>
  75. </article>
  76. </div>
  77. <span class="line">
  78. <hr>
  79. </span>
  80. </div>
  81. </div>
  82. {{ end }}
  83. {{ end }}
  84. </div> -->