single.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. {{- define "main" -}}
  2. <article class="article article-project" itemscope itemtype="http://schema.org/Article">
  3. {{ partial "page_header.html" . }}
  4. <div class="article-container">
  5. <div class="article-style" itemprop="articleBody">
  6. {{ .Content }}
  7. </div>
  8. {{ partial "tags.html" . }}
  9. {{ partial "page_author.html" . }}
  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" "talk") ".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. </article>
  58. {{ if site.Params.section_pager }}
  59. <div class="article-container article-widget">
  60. {{ partial "section_pager.html" . }}
  61. </div>
  62. {{ end }}
  63. {{- end -}}