about.html 3.7 KB

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