recent-posts.html 814 B

123456789101112131415161718192021222324252627
  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 site.RegularPages.ByDate.Reverse "Type" "in" "posts" )}}
  20. {{ partial "cards/recent-post.html" . }}
  21. {{ end }}
  22. </div>
  23. </div>
  24. </div>