Skip to content

Source AuthorBio photo, name, and bio from the Ghost author profile - #14

Merged
amrtgaber merged 1 commit into
mainfrom
author-bio-from-ghost
Jul 20, 2026
Merged

Source AuthorBio photo, name, and bio from the Ghost author profile#14
amrtgaber merged 1 commit into
mainfrom
author-bio-from-ghost

Conversation

@amrtgaber

Copy link
Copy Markdown
Contributor

Summary

The AuthorBio component (home + about pages) had a hardcoded placeholder circle and hardcoded name/bio strings, so changing the author photo meant a code change and deploy. This wires it to the Ghost author profile — the same source the blog post footers already use — so the photo and bio become editable in Ghost Admin with no deploy.

  • Add getAuthor(slug) to src/api/ghost.ts (Content API authors/slug/ endpoint) and an authors field to GhostResponse
  • Add a useAuthor hook in src/lib/use-ghost.ts following the existing hook patterns
  • AuthorBio renders the Ghost profile_image / name / bio when present, and falls back to the previous hardcoded content while the Ghost profile fields are empty (or if the Content API is unreachable) — so this is a no-op visually until the profile is filled in
  • Component tests cover both the fallback and Ghost-data states

Testing

  • vitest run: 4 tests pass (2 new)
  • Verified locally against production Ghost: the page issues one request to authors/slug/will/ and renders the fallback correctly while the profile is empty

The AuthorBio component on the home and about pages had a hardcoded
placeholder circle and hardcoded name/bio strings, so updating the author
photo required a code change and deploy.

- Add getAuthor(slug) to the Ghost Content API client (authors/slug/ endpoint)
  and an authors field to GhostResponse
- Add a useAuthor hook following the existing use-ghost patterns
- AuthorBio now renders the Ghost profile image, name, and bio when present,
  falling back to the previous hardcoded content while the Ghost profile
  fields are empty or the API is unreachable
- Component tests cover both the fallback and Ghost-data states

The author can now update their photo and bio in Ghost Admin with no deploy;
post footers already read the same profile.
@netlify

netlify Bot commented Jul 20, 2026

Copy link
Copy Markdown

Deploy Preview for treepolitics-web ready!

Name Link
🔨 Latest commit 5367c40
🔍 Latest deploy log https://app.netlify.com/projects/treepolitics-web/deploys/6a5ea18862363e00095073ad
😎 Deploy Preview https://deploy-preview-14--treepolitics-web.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@amrtgaber
amrtgaber merged commit aa7061c into main Jul 20, 2026
6 checks passed
@amrtgaber
amrtgaber deleted the author-bio-from-ghost branch July 20, 2026 22:32
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.

1 participant