Skip to content

docs: fix team page GitHub avatar loading - #1130

Merged
dengliming merged 4 commits into
apache:mainfrom
wy471x:fix/team-page-github-avatar-loading
Jul 28, 2026
Merged

docs: fix team page GitHub avatar loading#1130
dengliming merged 4 commits into
apache:mainfrom
wy471x:fix/team-page-github-avatar-loading

Conversation

@wy471x

@wy471x wy471x commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary of Changes

Branch: fix/team-page-github-avatar-loading

Problem: Member avatars on the /team page were failing to load because avatars.githubusercontent.com is unreliable in certain regions. The team page (~55+ members) used direct CDN
URLs with no error handling.

Changes across 4 files (+304 / -215 lines):

  1. New: src/components/GitHubAvatar.tsx

A React component that replaces raw tags. Instead of showing a broken image on failure, it renders initials immediately as an inline SVG (colored background + extracted
initials from username), then loads the real GitHub avatar in the background. On success it swaps to the photo; on failure it keeps the initials. Users never see a broken image.

  1. New: static/img/team/default-avatar.svg

A fallback silhouette avatar SVG (kept as a static asset, though the component now uses inline SVG initials instead).

  1. Modified: src/pages/team.mdx (English)
  • All 55+ avatar tags replaced with
  • All http:// GitHub links upgraded to https://
  • Added import GitHubAvatar at top of file
  1. Modified: i18n/zh/docusaurus-plugin-content-pages/team.mdx (Chinese)
  • Same changes as the English file — all avatar tags replaced, all links upgraded to HTTPS

close #1112

wy471x and others added 4 commits July 27, 2026 21:30
…on team page

Replace avatars.githubusercontent.com URLs with github.com/<username>.png
format for all member avatars, add referrerpolicy="no-referrer" and onerror
fallback to handle image loading failures. Also fix http:// links to https://.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
HTML inline onerror attributes are stripped during MDX-to-JSX compilation in
Docusaurus. Replace raw <img> tags with a GitHubAvatar React component that
properly handles image load failures and shows a fallback avatar.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The import script accidentally added GitHubAvatar import in the middle of the
file where Contributors is imported, causing acorn MDX parsing errors.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replace the img-first-then-fallback approach with a render-initials-first
strategy. The component shows a colored circle with the user's initials
(Inline SVG) immediately, then tries to load the GitHub avatar in the
background. On success it swaps to the photo; on failure it keeps the
initials. Users never see a broken image regardless of network conditions.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@dengliming
dengliming merged commit 8ee016a into apache:main Jul 28, 2026
2 checks passed
@wy471x
wy471x deleted the fix/team-page-github-avatar-loading branch July 29, 2026 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]Team module, issue with avatar failing to load

2 participants