about.html 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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.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.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>{{ $person_page.Title }}</h2>
  31. {{ with $person.role }}<h3>{{ . | markdownify | emojify }}</h3>{{ end }}
  32. {{ range $person.organizations }}
  33. <h3>
  34. {{ with .url }}<a href="{{ . }}" target="_blank" rel="noopener">{{ end }}
  35. <span>{{ .name }}</span>
  36. {{ if .url }}</a>{{ end }}
  37. </h3>
  38. {{ end }}
  39. </div>
  40. <ul class="network-icon" aria-hidden="true">
  41. {{ range $person.social }}
  42. {{ $pack := or .icon_pack "fas" }}
  43. {{ $pack_prefix := $pack }}
  44. {{ if in (slice "fab" "fas" "far" "fal") $pack }}
  45. {{ $pack_prefix = "fa" }}
  46. {{ end }}
  47. {{ $link := .link }}
  48. {{ $scheme := (urls.Parse $link).Scheme }}
  49. {{ $target := "" }}
  50. {{ if not $scheme }}
  51. {{ $link = .link | relLangURL }}
  52. {{ else if in (slice "http" "https") $scheme }}
  53. {{ $target = "target=\"_blank\" rel=\"noopener\"" }}
  54. {{ end }}
  55. <li>
  56. <a href="{{ $link | safeURL }}" {{ $target | safeHTMLAttr }} aria-label="{{ .icon }}">
  57. <i class="{{ $pack }} {{ $pack_prefix }}-{{ .icon }} big-icon"></i>
  58. </a>
  59. </li>
  60. {{ end }}
  61. </ul>
  62. </div>
  63. </div>
  64. <div class="col-12 col-lg-8">
  65. {{/* Only display widget title in explicit instances of about widget, not in author pages. */}}
  66. {{ if and $page.Params.widget $page.Title }}<h1>{{ $page.Title | markdownify | emojify }}</h1>{{ end }}
  67. <div class="article-style">
  68. {{ $person_page.Content }}
  69. </div>
  70. <div class="row">
  71. {{ with $person.interests }}
  72. <div class="col-md-5">
  73. <div class="section-subheading">{{ i18n "interests" | markdownify }}</div>
  74. <ul class="ul-interests mb-0">
  75. {{ range . }}
  76. <li>{{ . | markdownify | emojify }}</li>
  77. {{ end }}
  78. </ul>
  79. </div>
  80. {{ end }}
  81. {{ with $person.education }}
  82. <div class="col-md-7">
  83. <div class="section-subheading">{{ i18n "education" | markdownify }}</div>
  84. <ul class="ul-edu fa-ul mb-0">
  85. {{ range .courses }}
  86. <li>
  87. <i class="fa-li fas fa-graduation-cap"></i>
  88. <div class="description">
  89. <p class="course">{{ .course }}{{ with .year }}, {{ . }}{{ end }}</p>
  90. <p class="institution">{{ .institution }}</p>
  91. </div>
  92. </li>
  93. {{ end }}
  94. </ul>
  95. </div>
  96. {{ end }}
  97. </div>
  98. </div>
  99. </div>