recent-posts.html 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. {{ $sectionID := replace (lower .section.name) " " "-" }}
  2. {{ if .section.id }}
  3. {{ $sectionID = .section.id }}
  4. {{ end }}
  5. {{ $numShow := 3}}
  6. {{ if .section.numShow }}
  7. {{ $numShow = .section.numShow }}
  8. {{ end }}
  9. <div class="container-fluid anchor pb-5 recent-posts-section">
  10. {{ if not (.section.hideTitle) }}
  11. <h1 class="text-center">
  12. <span id="{{ $sectionID }}"></span>{{ .section.name }}</h1>
  13. {{ else }}
  14. <h1 class="text-center" style="display: none">
  15. <span id="{{ $sectionID }}"></span>{{ .section.name }}</h1>
  16. {{ end }}
  17. <div class="container">
  18. <div class="row" id="recent-post-cards">
  19. {{ range first $numShow (where (where site.RegularPages.ByDate.Reverse "Type" "posts" ) "Layout" "!=" "search") }}
  20. {{ partial "cards/post.html" . }}
  21. {{ end }}
  22. </div>
  23. </div>
  24. {{ if (.section.showMoreButton) }}
  25. <div class="container" style="
  26. display: flex;
  27. align-items: center;
  28. justify-content: center;">
  29. <a href="/posts/" title="Show More" class="float-end btn btn-outline-info btn-sm" >
  30. {{ i18n "show_more"}}</a>
  31. </div>
  32. {{ end }}
  33. </div>