publications.html 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. {{ $ := .root }}
  2. {{ $page := .page }}
  3. {{ $query := where $.Site.RegularPages "Type" "publication" }}
  4. {{ if and ($page.Params.publication_type) (ne $page.Params.publication_type "-1") }}
  5. {{ $query = where $query ".Params.publication_types" "intersect" (slice $page.Params.publication_type) }}
  6. {{ end }}
  7. {{ if $page.Params.exclude_featured }}
  8. {{ $query = $query | intersect (where (where $.Site.RegularPages "Type" "publication") ".Params.featured" "!=" true) }}
  9. {{ end }}
  10. {{ $count := len $query }}
  11. <!-- Publications widget -->
  12. <div class="row">
  13. <div class="col-12 col-lg-4 section-heading">
  14. <h1>{{ with $page.Title }}{{ . | markdownify }}{{ end }}</h1>
  15. {{ with $page.Params.subtitle }}<p>{{ . | markdownify }}</p>{{ end }}
  16. </div>
  17. <div class="col-12 col-lg-8">
  18. {{ with $page.Content }}<p>{{ . | markdownify }}</p>{{ end }}
  19. {{ range first $page.Params.count $query }}
  20. {{ if eq $page.Params.view 1 }}
  21. {{ partial "publication_li_list" . }}
  22. {{ else if eq $page.Params.view 3 }}
  23. {{ partial "publication_li_card" . }}
  24. {{ else if eq $page.Params.view 4 }}
  25. {{ partial "publication_li_citation" . }}
  26. {{ else }}
  27. {{ partial "publication_li_compact" . }}
  28. {{ end }}
  29. {{ end }}
  30. {{ if gt $count $page.Params.count }}
  31. <div class="see-all">
  32. <a href="{{ ($.Site.GetPage "section" "publication").RelPermalink }}">
  33. {{ i18n "more_publications" | markdownify }}
  34. <i class="fas fa-angle-right"></i>
  35. </a>
  36. </div>
  37. {{ end }}
  38. </div>
  39. </div>