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