single.html 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 $index, $item := $items }}
  17. {{ partial "functions/render_view" (dict "page" $ "item" . "view" (site.Params.projects.post_view | default "compact") "index" $index) }}
  18. {{ partial "functions/render_view" (dict "page" $ "item" . "view" (site.Params.projects.post_view | default "compact") "index" $index) }}
  19. {{end}}
  20. {{ end }}
  21. {{ $items := where (where site.RegularPages "Type" "publication") ".Params.projects" "intersect" (slice $project) }}
  22. {{ $pubs_len := len $items }}
  23. {{ if ge $pubs_len 1 }}
  24. <h2>{{ (i18n "publications") }}</h2>
  25. {{ range $index, $item := $items }}
  26. {{ partial "functions/render_view" (dict "page" $ "item" . "view" (site.Params.projects.publication_view | default "compact") "index" $index) }}
  27. {{end}}
  28. {{ end }}
  29. {{ $items := where (where site.RegularPages "Type" "event") ".Params.projects" "intersect" (slice $project) }}
  30. {{ $talks_len := len $items }}
  31. {{ if ge $talks_len 1 }}
  32. <h2>{{ (i18n "talks") }}</h2>
  33. {{ range $index, $item := $items }}
  34. {{ partial "functions/render_view" (dict "page" $ "item" . "view" (site.Params.projects.talk_view | default "compact") "index" $index) }}
  35. {{end}}
  36. {{ end }}
  37. </div>
  38. </div>
  39. </article>
  40. {{- end -}}