gravatar

Avatar URL helper.

Hashes an email the same way Gravatar does and returns a first-party /avatars/{hash} URL served by crate::web::handlers::avatar. The dashboard never references gravatar.com directly: all avatar requests go through the local proxy so browsing activity is not leaked to a third party and the dashboard works in air-gapped deployments.

fn url

source

pub(crate) fn url(email: Option<&str>) -> Option<String>

Build a first-party avatar URL from an email address (or None).

Returns None when the email is absent so templates can conditionally omit the <img> tag. The hash format matches Gravatar’s scheme (lowercase MD5 of the trimmed, lowercased email) so the local AvatarCache can use the same identifier when fetching upstream bytes on a cache miss.

Parameter Type Description
email Option<&str> the author’s email address, or None
returns Option<String> The URL /avatars/<hash>, or None when email is None.