single.html 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. {{- define "main" -}}
  2. {{ $pub_types := partial "functions/get_pub_types" $ }}
  3. {{ $pub_type_param := .Params.publication_types | default (slice 0) }}
  4. {{/* Convert string in form `"0"` to int (`0`) */}}
  5. {{ $pub_type := (int (index $pub_type_param 0)) | default 0 }}
  6. {{/* Validate Pub Type if defined */}}
  7. {{ if gt $pub_type (sub (len $pub_types) 1) }}
  8. {{ warnf "Unknown publication type in %s" .Path }}
  9. {{ $pub_type = 0 }}
  10. {{ end }}
  11. <div class="pub">
  12. {{ partial "page_header.html" . }}
  13. <div class="article-container">
  14. {{ if .Params.abstract }}
  15. <h3>{{ i18n "abstract" }}</h3>
  16. <p class="pub-abstract">{{ .Params.abstract | markdownify }}</p>
  17. {{ end }}
  18. {{/* If the type is Uncategorized, hide the type. */}}
  19. {{ if ne $pub_type 0 }}
  20. <div class="row">
  21. <div class="col-md-1"></div>
  22. <div class="col-md-10">
  23. <div class="row">
  24. <div class="col-12 col-md-3 pub-row-heading">{{ i18n "publication_type" }}</div>
  25. <div class="col-12 col-md-9">
  26. <a href="{{ (site.GetPage "section" "publication").RelPermalink }}#{{ $pub_type | anchorize }}">
  27. {{ index $pub_types $pub_type }}
  28. </a>
  29. </div>
  30. </div>
  31. </div>
  32. <div class="col-md-1"></div>
  33. </div>
  34. <div class="d-md-none space-below"></div>
  35. {{ end }}
  36. {{ if .Params.publication }}
  37. <div class="row">
  38. <div class="col-md-1"></div>
  39. <div class="col-md-10">
  40. <div class="row">
  41. <div class="col-12 col-md-3 pub-row-heading">{{ i18n "publication" }}</div>
  42. <div class="col-12 col-md-9">{{ .Params.publication | markdownify }}</div>
  43. </div>
  44. </div>
  45. <div class="col-md-1"></div>
  46. </div>
  47. <div class="d-md-none space-below"></div>
  48. {{ end }}
  49. <div class="space-below"></div>
  50. <div class="article-style">{{ .Content }}</div>
  51. {{ partial "page_footer" . }}
  52. </div>
  53. </div>
  54. {{- end -}}