single.html 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 "tags.html" . }}
  9. {{ partial "page_author.html" . }}
  10. {{ partial "comments" . }}
  11. {{ $page := . }}
  12. {{ $project := .File.ContentBaseName }}
  13. {{ $items := where (where site.RegularPages "Type" "post") ".Params.projects" "intersect" (slice $project) }}
  14. {{ $count := len $items }}
  15. {{ if ge $count 1 }}
  16. <h2>{{ (i18n "posts") }}</h2>
  17. {{ range $items }}
  18. {{ if eq site.Params.projects.post_view 1 }}
  19. {{ partial "li_list" . }}
  20. {{ else if eq site.Params.projects.post_view 3 }}
  21. {{ partial "li_card" . }}
  22. {{ else }}
  23. {{ partial "li_compact" . }}
  24. {{ end }}
  25. {{ end }}
  26. {{ end }}
  27. {{ $items := where (where site.RegularPages "Type" "publication") ".Params.projects" "intersect" (slice $project) }}
  28. {{ $pubs_len := len $items }}
  29. {{ if ge $pubs_len 1 }}
  30. <h2>{{ (i18n "publications") }}</h2>
  31. {{ range $items }}
  32. {{ if eq site.Params.projects.publication_view 1 }}
  33. {{ partial "li_list" . }}
  34. {{ else if eq site.Params.projects.publication_view 3 }}
  35. {{ partial "li_card" . }}
  36. {{ else if eq site.Params.projects.publication_view 4 }}
  37. {{ partial "li_citation" . }}
  38. {{ else }}
  39. {{ partial "li_compact" . }}
  40. {{ end }}
  41. {{ end }}
  42. {{ end }}
  43. {{ $items := where (where site.RegularPages "Type" "talk") ".Params.projects" "intersect" (slice $project) }}
  44. {{ $talks_len := len $items }}
  45. {{ if ge $talks_len 1 }}
  46. <h2>{{ (i18n "talks") }}</h2>
  47. {{ range $items }}
  48. {{ if eq site.Params.projects.talk_view 1 }}
  49. {{ partial "li_list" . }}
  50. {{ else if eq site.Params.projects.talk_view 3 }}
  51. {{ partial "li_card" . }}
  52. {{ else }}
  53. {{ partial "li_compact" . }}
  54. {{ end }}
  55. {{ end }}
  56. {{ end }}
  57. </div>
  58. </article>
  59. {{ if site.Params.section_pager }}
  60. <div class="article-container article-widget">
  61. {{ partial "section_pager.html" . }}
  62. </div>
  63. {{ end }}
  64. {{- end -}}