Files
HugoBlox-kit/modules/blox-tailwind/layouts/_partials/page_author_card.html
T
George Cushen bec38c8759 feat: improve avatar quality and add customizable sizing options
Resolves #3123

## What Changed

**Avatar Quality Improvements:**
- Generate avatars at 2x resolution for crisp display on high-DPI screens
- Updated Hugo imaging config with quality: 90, lanczos resampling, and picture hint
- Improved WebP compression quality across all avatar locations

**New Customization Parameters:**
- Added design.avatar.size with 5 options: small (150px), medium (200px), large (320px), xl (400px), xxl (500px)
- Added design.avatar.shape with 3 options: circle (default), square, rounded
- Sizing aligned with 2025 social media standards (LinkedIn/X: 400px, Instagram: 320px, TikTok: 200px)

**Updated Templates:**
- Enhanced resume-biography.html and resume-biography-3.html with flexible parameter system
- Updated all starter templates (academic-cv, resume, blog, link-in-bio) with example configurations
- Improved avatar CSS for dynamic sizing control
2025-08-18 02:43:55 +01:00

63 lines
2.1 KiB
HTML

{{ $page := .page }}
{{ $author_page := .author_page }}
{{ $site_type := site.Params.marketing.seo.site_type | default "Person" }}
{{- $has_profile := not (eq nil $author_page.Params.superuser) -}}
{{/* Check an author profile exists. */}}
{{ if $has_profile }}
{{/* If it's a personal site and primary page author is superuser, link to the homepage rather than their profile page. */}}
{{ $profile_url := $author_page.RelPermalink }}
{{ if and (eq $site_type "Person") (eq $author_page.Params.superuser true) }}
{{ $profile_url = site.BaseURL }}
{{ end }}
{{ $avatar := ($author_page.Resources.ByType "image").GetMatch "*avatar*" }}
{{ $avatar_shape := site.Params.features.avatar.shape | default "circle" }}
<div class="flex pt-12 pb-4">
{{ if $avatar }}
{{ $authorImage := $avatar.Fill "384x384 Center" }}
<img
class="mr-4 h-24 w-24 {{if ne $avatar_shape "square"}}rounded-full{{end}}"
width="96"
height="96"
alt="{{$author_page.Title}}"
src="{{ $authorImage.RelPermalink }}"
loading="lazy"
/>
{{ end }}
<div class="place-self-center">
<div class="text-[0.6rem] uppercase leading-3 text-neutral-500 dark:text-neutral-400">
{{ i18n "authors" }}
</div>
<div class="font-semibold leading-6 text-neutral-800 dark:text-neutral-300">
<span class="inline-block">
{{if $profile_url}}<a href="{{$profile_url}}" class="no-underline">{{end}}
{{$author_page.Title}}
{{if $profile_url}}</a>{{end}}
</span>
{{- with $author_page.Params.pronouns -}}
<span class="text-sm font-normal text-gray-600 dark:text-gray-400 ml-1 inline-block">({{ . }})</span>
{{- end -}}
</div>
{{ with $author_page.Params.role }}
<div class="text-sm font-bold text-neutral-700 dark:text-neutral-300">
{{. | markdownify | emojify}}
</div>
{{end}}
{{ with $author_page.Params.bio }}
<div class="text-sm text-neutral-700 dark:text-neutral-300">{{ . | markdownify | emojify }}</div>
{{ end }}
<div class="text-2xl sm:text-lg pt-1">
{{ partial "social_links" $author_page }}
</div>
</div>
</div>
{{end}}{{/* End Check for Author Profile */}}