single.html 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. {{- define "main" -}}
  2. <article class="article article-project">
  3. {{ partial "page_header.html" . }}
  4. <div class="article-container">
  5. <div class="article-style">
  6. {{ .Content }}
  7. </div>
  8. {{ partial "page_footer" . }}
  9. <div class="project-related-pages content-widget-hr">
  10. {{ $page := . }}
  11. {{ $project := .File.ContentBaseName }}
  12. {{ $items := where (where site.RegularPages "Type" "post") ".Params.projects" "intersect" (slice $project) }}
  13. {{ $count := len $items }}
  14. {{ if ge $count 1 }}
  15. <h2>{{ (i18n "posts") }}</h2>
  16. {{ range $items }}
  17. {{ if eq site.Params.projects.post_view 1 }}
  18. {{ partial "li_list" . }}
  19. {{ else if eq site.Params.projects.post_view 3 }}
  20. {{ partial "li_card" . }}
  21. {{ else }}
  22. {{ partial "li_compact" . }}
  23. {{ end }}
  24. {{ end }}
  25. {{ end }}
  26. {{ $items := where (where site.RegularPages "Type" "publication") ".Params.projects" "intersect" (slice $project) }}
  27. {{ $pubs_len := len $items }}
  28. {{ if ge $pubs_len 1 }}
  29. <h2>{{ (i18n "publications") }}</h2>
  30. {{ range $items }}
  31. {{ if eq site.Params.projects.publication_view 1 }}
  32. {{ partial "li_list" . }}
  33. {{ else if eq site.Params.projects.publication_view 3 }}
  34. {{ partial "li_card" . }}
  35. {{ else if eq site.Params.projects.publication_view 4 }}
  36. {{ partial "li_citation" . }}
  37. {{ else }}
  38. {{ partial "li_compact" . }}
  39. {{ end }}
  40. {{ end }}
  41. {{ end }}
  42. {{ $items := where (where site.RegularPages "Type" "event") ".Params.projects" "intersect" (slice $project) }}
  43. {{ $talks_len := len $items }}
  44. {{ if ge $talks_len 1 }}
  45. <h2>{{ (i18n "talks") }}</h2>
  46. {{ range $items }}
  47. {{ if eq site.Params.projects.talk_view 1 }}
  48. {{ partial "li_list" . }}
  49. {{ else if eq site.Params.projects.talk_view 3 }}
  50. {{ partial "li_card" . }}
  51. {{ else }}
  52. {{ partial "li_compact" . }}
  53. {{ end }}
  54. {{ end }}
  55. {{ end }}
  56. </div>
  57. </div>
  58. </article>
  59. {{- end -}}