single.html 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. {{ partial "header.html" . }}
  2. {{ partial "navbar.html" . }}
  3. <article class="article article-project" itemscope itemtype="http://schema.org/Article">
  4. {{ partial "page_header.html" . }}
  5. <div class="article-container">
  6. <div class="article-style" itemprop="articleBody">
  7. {{ .Content }}
  8. </div>
  9. {{ partial "tags.html" . }}
  10. {{ partial "page_author.html" . }}
  11. {{ $page := . }}
  12. {{ $project := .Slug }}
  13. {{ if not $project }}{{/* If user did not explicitly set `slug` in front matter. */}}
  14. {{ $project = .File.TranslationBaseName }}
  15. {{ end }}
  16. {{ if eq $project "index" }}{{/* Check if using dir-based page bundles. */}}
  17. {{ $project = delimit (last 1 (split (substr .Dir 0 -1) "/")) "" }}
  18. {{ end }}
  19. {{ $project_path := .RelPermalink }}
  20. {{ if (.Site.Params.projects.list_children | default true) }}
  21. {{ $items := where (where .Site.RegularPages "Type" "post") ".Params.projects" "intersect" (slice $project) }}
  22. {{ $count := len $items }}
  23. {{ if ge $count 1 }}
  24. <h2>{{ (i18n "posts") }}</h2>
  25. {{ range $items }}
  26. {{ if eq $page.Site.Params.projects.post_format 0 }}
  27. {{ partial "post_li_simple" . }}
  28. {{ else if eq $page.Site.Params.projects.post_format 1 }}
  29. {{ partial "post_li_detailed" . }}
  30. {{ else }}
  31. {{ partial "post_li_stream" . }}
  32. {{ end }}
  33. {{ end }}
  34. {{ end }}
  35. {{ $items := where (where .Site.RegularPages "Type" "publication") ".Params.projects" "intersect" (slice $project) }}
  36. {{ $items := $items | union (where (where .Site.RegularPages "Type" "publication") ".Params.url_project" $project_path) }}
  37. {{ $pubs_len := len $items }}
  38. {{ if ge $pubs_len 1 }}
  39. <h2>{{ (i18n "publications") }}</h2>
  40. {{ range $items }}
  41. {{ if eq $page.Site.Params.projects.publication_format 1 }}
  42. {{ partial "publication_li_detailed" . }}
  43. {{ else if eq $page.Site.Params.projects.publication_format 2 }}
  44. {{ partial "publication_li_apa" . }}
  45. {{ else if eq $page.Site.Params.projects.publication_format 3 }}
  46. {{ partial "publication_li_mla" . }}
  47. {{ else if eq $page.Site.Params.projects.publication_format 4 }}
  48. {{ partial "publication_li_stream" . }}
  49. {{ else }}
  50. {{ partial "publication_li_simple" . }}
  51. {{ end }}
  52. {{ end }}
  53. {{ end }}
  54. {{ $items := where (where .Site.RegularPages "Type" "talk") ".Params.projects" "intersect" (slice $project) }}
  55. {{ $items := $items | union (where (where .Site.RegularPages "Type" "talk") ".Params.url_project" $project_path) }}
  56. {{ $talks_len := len $items }}
  57. {{ if ge $talks_len 1 }}
  58. <h2>{{ (i18n "talks") }}</h2>
  59. {{ range sort $items ".Params.time_start" "desc" }}
  60. {{ if eq $page.Site.Params.projects.talk_format 1 }}
  61. {{ partial "talk_li_detailed" . }}
  62. {{ else if eq $page.Site.Params.projects.talk_format 2 }}
  63. {{ partial "talk_li_stream" . }}
  64. {{ else }}
  65. {{ partial "talk_li_simple" . }}
  66. {{ end }}
  67. {{ end }}
  68. {{ end }}
  69. {{ end }}
  70. </div>
  71. </article>
  72. {{ if .Site.Params.section_pager }}
  73. <div class="article-container article-widget">
  74. {{ partial "section_pager.html" . }}
  75. </div>
  76. {{ end }}
  77. {{ partial "footer_container.html" . }}
  78. {{ partial "footer.html" . }}