|
| 1 | +{{ with .Params.show_author_bios }} |
| 2 | +{{ if . }} |
| 3 | +<div class="author-bios-section mt-12 pt-8"> |
| 4 | + <h2 class="text-3xl font-bold mb-8">About the Author{{ if gt (len $.Params.author) 1 }}s{{ end }}</h2> |
| 5 | + {{ with $.Params.author }} |
| 6 | + {{ $authors := . }} |
| 7 | + {{ range $index, $authorName := $authors }} |
| 8 | + {{ $isFirstAuthor := eq $index 0 }} |
| 9 | + {{ $nameForSlug := $authorName | replaceRE "[.]" "" | replaceRE "ć" "c" | replaceRE "Ć" "C" }} |
| 10 | + {{ $contributorSlug := $nameForSlug | anchorize }} |
| 11 | + {{ $contributorPage := $.Site.GetPage (printf "contributors/%s" $contributorSlug) }} |
| 12 | + |
| 13 | + <div class="author-bio-item mb-8 flex flex-col {{ if $isFirstAuthor }}md:flex-row{{ else }}md:flex-row{{ end }} items-start gap-6"> |
| 14 | + {{ if $contributorPage }} |
| 15 | + {{ with $contributorPage.Params.image }} |
| 16 | + <div class="flex-shrink-0 text-center"> |
| 17 | + <a href="{{ $contributorPage.RelPermalink }}"> |
| 18 | + {{ partial "image" (dict "Src" . "Context" $contributorPage "Alt" $contributorPage.Title "Class" (printf "rounded-full object-cover shadow-md mx-auto %s" (cond $isFirstAuthor "w-32 h-32" "w-24 h-24")) "Size" (cond $isFirstAuthor "128x128" "96x96") "Command" "Fill") }} |
| 19 | + </a> |
| 20 | + </div> |
| 21 | + {{ else }} |
| 22 | + <div class="flex-shrink-0 {{ cond $isFirstAuthor "w-32 h-32" "w-24 h-24" }} bg-gray-200 dark:bg-darkmode-theme-dark rounded-full flex items-center justify-center mx-auto"> |
| 23 | + {{ partial "icon.html" (dict "style" "solid" "name" "user" "class" "text-4xl text-gray-400") }} |
| 24 | + </div> |
| 25 | + {{ end }} |
| 26 | + <div class="flex-grow text-center {{ if $isFirstAuthor }}md:text-left{{ else }}md:text-left{{ end }}"> |
| 27 | + <h3 class="text-2xl font-semibold mb-1"> |
| 28 | + <a href="{{ $contributorPage.RelPermalink }}" class="text-dark dark:text-darkmode-dark hover:text-primary dark:hover:text-darkmode-primary">{{ $authorName }}</a> |
| 29 | + </h3> |
| 30 | + <div class="prose prose-sm dark:prose-invert max-w-none text-text dark:text-darkmode-text"> |
| 31 | + {{ $contributorPage.Description | plainify }} |
| 32 | + </div> |
| 33 | + {{ with $contributorPage.Params.social }} |
| 34 | + <ul class="contributor-socials flex justify-center {{ if $isFirstAuthor }}md:justify-start{{ else }}md:justify-start{{ end }} space-x-3 mt-4"> |
| 35 | + {{ range . }} |
| 36 | + <li> |
| 37 | + <a href="{{ .link | safeURL }}" target="_blank" rel="noopener noreferrer" aria-label="{{ .title }}" class="text-xl"> |
| 38 | + {{ $iconData := partial "helpers/parse-fa-class.html" .icon }}{{ partial "icon.html" (dict "style" $iconData.style "name" $iconData.name "class" "") }} |
| 39 | + </a> |
| 40 | + </li> |
| 41 | + {{ end }} |
| 42 | + </ul> |
| 43 | + {{ end }} |
| 44 | + </div> |
| 45 | + {{ else }} |
| 46 | + <div class="w-24 h-24 bg-gray-200 dark:bg-darkmode-theme-dark rounded-full flex items-center justify-center mx-auto md:mx-0 flex-shrink-0"> |
| 47 | + {{ partial "icon.html" (dict "style" "solid" "name" "user" "class" "text-4xl text-gray-400") }} |
| 48 | + </div> |
| 49 | + <div class="flex-grow text-center md:text-left"> |
| 50 | + <h3 class="text-2xl font-semibold mb-1">{{ $authorName }}</h3> |
| 51 | + <p class="text-sm text-gray-500 italic">Contributor profile not found.</p> |
| 52 | + </div> |
| 53 | + {{ end }} |
| 54 | +</div> |
| 55 | +{{ end }} |
| 56 | +{{ end }} |
| 57 | +</div> |
| 58 | +{{ end }} |
| 59 | +{{ end }} |
0 commit comments