Source AuthorBio photo, name, and bio from the Ghost author profile - #14
Merged
Conversation
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.
✅ Deploy Preview for treepolitics-web ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
AuthorBiocomponent (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.getAuthor(slug)tosrc/api/ghost.ts(Content APIauthors/slug/endpoint) and anauthorsfield toGhostResponseuseAuthorhook insrc/lib/use-ghost.tsfollowing the existing hook patternsAuthorBiorenders the Ghostprofile_image/name/biowhen 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 inTesting
vitest run: 4 tests pass (2 new)authors/slug/will/and renders the fallback correctly while the profile is empty