about.html 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. {{ $ := .root }}
  2. {{ $page := .page }}
  3. {{ $author := "" }}
  4. {{ if .author }}
  5. {{ $author = .author }}
  6. {{ else }}
  7. {{ $author = $page.Params.author }}
  8. {{end}}
  9. {{ $person_page_path := (printf "/authors/%s" $author) }}
  10. {{ $person_page := site.GetPage $person_page_path }}
  11. {{ if not $person_page }}
  12. {{ errorf "Could not find an author page at `%s`. Please check the value of `author` in your About widget and create an associated author page if one does not already exist. See https://wowchemy.com/docs/page-builder/#about " $person_page_path }}
  13. {{end}}
  14. {{ $person := $person_page.Params }}
  15. {{ $avatar := ($person_page.Resources.ByType "image").GetMatch "*avatar*" }}
  16. {{ $avatar_shape := site.Params.features.avatar.shape | default "circle" }}
  17. <!-- About widget -->
  18. <div class="row">
  19. <div class="col-12 col-lg-4">
  20. <div id="profile">
  21. {{ if site.Params.features.avatar.gravatar }}
  22. <img class="avatar {{if eq $avatar_shape "square"}}avatar-square{{else}}avatar-circle{{end}}" src="https://s.gravatar.com/avatar/{{ md5 $person.email }}?s=270')" alt="{{$person_page.Title}}">
  23. {{ else if $avatar }}
  24. {{ $avatar_image := $avatar.Fill "270x270 Center" }}
  25. <img class="avatar {{if eq $avatar_shape "square"}}avatar-square{{else}}avatar-circle{{end}}"
  26. width="{{ $avatar_image.Width }}" height="{{ $avatar_image.Height }}"
  27. src="{{ $avatar_image.RelPermalink }}" alt="{{$person_page.Title}}">
  28. {{ end }}
  29. <div class="portrait-title">
  30. <h2>
  31. {{- if $person.name_pronunciation -}}
  32. <ruby>
  33. <rb>{{ $person_page.Title }}</rb>
  34. <rt>{{ $person.name_pronunciation }}</rt>
  35. </ruby>
  36. {{- else -}}
  37. {{- $person_page.Title -}}
  38. {{- end -}}
  39. </h2>
  40. {{ with $person.role }}<h3>{{ . | markdownify | emojify }}</h3>{{ end }}
  41. {{ range $person.organizations }}
  42. <h3>
  43. {{ with .url }}<a href="{{ . }}" target="_blank" rel="noopener">{{ end }}
  44. <span>{{ .name }}</span>
  45. {{ if .url }}</a>{{ end }}
  46. </h3>
  47. {{ end }}
  48. </div>
  49. <ul class="network-icon" aria-hidden="true">
  50. {{ range $person.social }}
  51. {{ $pack := or .icon_pack "fas" }}
  52. {{ $pack_prefix := $pack }}
  53. {{ if in (slice "fab" "fas" "far" "fal") $pack }}
  54. {{ $pack_prefix = "fa" }}
  55. {{ end }}
  56. {{ $link := .link }}
  57. {{ $scheme := (urls.Parse $link).Scheme }}
  58. {{ $target := "" }}
  59. {{ if not $scheme }}
  60. {{ $link = .link | relLangURL }}
  61. {{ else if in (slice "http" "https") $scheme }}
  62. {{ $target = "target=\"_blank\" rel=\"noopener\"" }}
  63. {{ end }}
  64. <li>
  65. <a href="{{ $link | safeURL }}" {{ $target | safeHTMLAttr }} aria-label="{{ .icon }}">
  66. <i class="{{ $pack }} {{ $pack_prefix }}-{{ .icon }} big-icon"></i>
  67. </a>
  68. </li>
  69. {{ end }}
  70. </ul>
  71. </div>
  72. </div>
  73. <div class="col-12 col-lg-8">
  74. {{/* Only display widget title in explicit instances of about widget, not in author pages. */}}
  75. {{ if and $page.Params.widget $page.Title }}<h1>{{ $page.Title | markdownify | emojify }}</h1>{{ end }}
  76. <div class="article-style">
  77. {{ $person_page.Content }}
  78. </div>
  79. <div class="row">
  80. {{ with $person.interests }}
  81. <div class="col-md-5">
  82. <div class="section-subheading">{{ i18n "interests" | markdownify }}</div>
  83. <ul class="ul-interests mb-0">
  84. {{ range . }}
  85. <li>{{ . | markdownify | emojify }}</li>
  86. {{ end }}
  87. </ul>
  88. </div>
  89. {{ end }}
  90. {{ with $person.education }}
  91. <div class="col-md-7">
  92. <div class="section-subheading">{{ i18n "education" | markdownify }}</div>
  93. <ul class="ul-edu fa-ul mb-0">
  94. {{ range .courses }}
  95. <li>
  96. <i class="fa-li fas fa-graduation-cap"></i>
  97. <div class="description">
  98. <p class="course">{{ .course }}{{ with .year }}, {{ . }}{{ end }}</p>
  99. <p class="institution">{{ .institution }}</p>
  100. </div>
  101. </li>
  102. {{ end }}
  103. </ul>
  104. </div>
  105. {{ end }}
  106. </div>
  107. </div>
  108. </div>