publications.html 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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-xs-12 col-md-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="{{ "/publication/" | relLangURL }}">
  12. {{ i18n "more_publications" | markdownify }}
  13. <i class="fa fa-angle-double-right"></i>
  14. </a>
  15. </p>
  16. {{ end }}
  17. </div>
  18. <div class="col-xs-12 col-md-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. {{ $recent_pubs := $.Scratch.Get "recent_pubs" }}
  26. {{ range first $page.Params.count $recent_pubs }}
  27. {{ if eq $page.Params.list_format 1 }}
  28. {{ partial "publication_li_detailed" . }}
  29. {{ else if eq $page.Params.list_format 2 }}
  30. {{ partial "publication_li_apa" . }}
  31. {{ else if eq $page.Params.list_format 3 }}
  32. {{ partial "publication_li_mla" . }}
  33. {{ else }}
  34. {{ partial "publication_li_simple" . }}
  35. {{ end }}
  36. {{ end }}
  37. </div>
  38. </div>