publications.html 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. {{ $ := .root }}
  2. {{ $page := .page }}
  3. {{ $pubs_len := len (where $.Site.RegularPages "Type" "publication") }}
  4. <!-- Publications widget -->
  5. <div class="row">
  6. <div class="col-12 col-lg-4 section-heading">
  7. <h1>{{ with $page.Title }}{{ . | markdownify }}{{ end }}</h1>
  8. {{ with $page.Params.subtitle }}<p>{{ . | markdownify }}</p>{{ end }}
  9. {{ if gt $pubs_len $page.Params.count }}
  10. <p class="view-all">
  11. <a href="{{ ($.Site.GetPage "section" "publication").RelPermalink }}">
  12. {{ i18n "more_publications" | markdownify }}
  13. <i class="fas fa-angle-double-right"></i>
  14. </a>
  15. </p>
  16. {{ end }}
  17. </div>
  18. <div class="col-12 col-lg-8">
  19. {{ with $page.Content }}<p>{{ . | markdownify }}</p>{{ end }}
  20. {{ if and ($page.Params.publication_type) (ne $page.Params.publication_type "-1") }}
  21. {{ $.Scratch.Set "recent_pubs" (where (where $.Site.RegularPages "Type" "publication") ".Params.publication_types" "intersect" (slice $page.Params.publication_type)) }}
  22. {{ else }}
  23. {{ $.Scratch.Set "recent_pubs" (where $.Site.RegularPages "Type" "publication") }}
  24. {{ end }}
  25. {{ if $page.Params.exclude_selected }}
  26. {{ $.Scratch.Set "recent_pubs" ( ($.Scratch.Get "recent_pubs") | intersect (where (where $.Site.RegularPages "Type" "publication") ".Params.selected" "!=" true) ) }}
  27. {{ end }}
  28. {{ $recent_pubs := $.Scratch.Get "recent_pubs" }}
  29. {{ range first $page.Params.count $recent_pubs }}
  30. {{ if eq $page.Params.list_format 1 }}
  31. {{ partial "publication_li_detailed" . }}
  32. {{ else if eq $page.Params.list_format 2 }}
  33. {{ partial "publication_li_apa" . }}
  34. {{ else if eq $page.Params.list_format 3 }}
  35. {{ partial "publication_li_mla" . }}
  36. {{ else if eq $page.Params.list_format 4 }}
  37. {{ partial "publication_li_stream" . }}
  38. {{ else }}
  39. {{ partial "publication_li_simple" . }}
  40. {{ end }}
  41. {{ end }}
  42. </div>
  43. </div>