single.html 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. {{ $dir_sep := substr .Dir -1 1 }}
  18. {{ $project = delimit (last 1 (split (substr .Dir 0 -1) $dir_sep)) "" }}
  19. {{ end }}
  20. {{ $project_path := .RelPermalink }}
  21. {{ if (.Site.Params.projects.list_children | default true) }}
  22. {{ $items := where (where .Site.RegularPages "Type" "post") ".Params.projects" "intersect" (slice $project) }}
  23. {{ $count := len $items }}
  24. {{ if ge $count 1 }}
  25. <h2>{{ (i18n "posts") }}</h2>
  26. {{ range $items }}
  27. {{ if eq $page.Site.Params.projects.post_format 0 }}
  28. {{ partial "post_li_simple" . }}
  29. {{ else if eq $page.Site.Params.projects.post_format 1 }}
  30. {{ partial "post_li_detailed" . }}
  31. {{ else }}
  32. {{ partial "post_li_stream" . }}
  33. {{ end }}
  34. {{ end }}
  35. {{ end }}
  36. {{ $items := where (where .Site.RegularPages "Type" "publication") ".Params.projects" "intersect" (slice $project) }}
  37. {{ $items := $items | union (where (where .Site.RegularPages "Type" "publication") ".Params.url_project" $project_path) }}
  38. {{ $pubs_len := len $items }}
  39. {{ if ge $pubs_len 1 }}
  40. <h2>{{ (i18n "publications") }}</h2>
  41. {{ range $items }}
  42. {{ if eq $page.Site.Params.projects.publication_format 1 }}
  43. {{ partial "publication_li_detailed" . }}
  44. {{ else if eq $page.Site.Params.projects.publication_format 2 }}
  45. {{ partial "publication_li_apa" . }}
  46. {{ else if eq $page.Site.Params.projects.publication_format 3 }}
  47. {{ partial "publication_li_mla" . }}
  48. {{ else if eq $page.Site.Params.projects.publication_format 4 }}
  49. {{ partial "publication_li_stream" . }}
  50. {{ else }}
  51. {{ partial "publication_li_simple" . }}
  52. {{ end }}
  53. {{ end }}
  54. {{ end }}
  55. {{ $items := where (where .Site.RegularPages "Type" "talk") ".Params.projects" "intersect" (slice $project) }}
  56. {{ $items := $items | union (where (where .Site.RegularPages "Type" "talk") ".Params.url_project" $project_path) }}
  57. {{ $talks_len := len $items }}
  58. {{ if ge $talks_len 1 }}
  59. <h2>{{ (i18n "talks") }}</h2>
  60. {{ range sort $items ".Params.time_start" "desc" }}
  61. {{ if eq $page.Site.Params.projects.talk_format 1 }}
  62. {{ partial "talk_li_detailed" . }}
  63. {{ else if eq $page.Site.Params.projects.talk_format 2 }}
  64. {{ partial "talk_li_stream" . }}
  65. {{ else }}
  66. {{ partial "talk_li_simple" . }}
  67. {{ end }}
  68. {{ end }}
  69. {{ end }}
  70. {{ end }}
  71. </div>
  72. </article>
  73. {{ if .Site.Params.section_pager }}
  74. <div class="article-container article-widget">
  75. {{ partial "section_pager.html" . }}
  76. </div>
  77. {{ end }}
  78. {{ partial "footer_container.html" . }}
  79. {{ partial "footer.html" . }}