✨ Added member.avatar_image for member gravatar usage in front-end#11584
Merged
Conversation
naz
reviewed
Feb 10, 2020
Contributor
There was a problem hiding this comment.
oh! nice use of destructuring 💯
kevinansfield
force-pushed
the
member-gravatar
branch
5 times, most recently
from
February 16, 2020 22:54
686ec2e to
52303fd
Compare
… image refs TryGhost/Product#243 - adds `hasFile()` method to active theme object to give other parts of the system easier fallback behaviour if an override file does not exist in the them - uses `member.toJSON()` to add a computed `avatar_image` property - starts with our "default" member avatar file that lives at `/content/images/members/avatar/default/` - attaches a version hash to more effectively clear caches when themes are updated - if the member has an email address and gravatar is not disabled then we generate a gravatar url using the `?d=` parameter that points to our default image location - adds a new middleware for dealing with member avatars to the `site` app - responds to `/content/images/members/avatar/default/` by serving 1. `assets/default-member-avatar.png` from the active theme 2. `public/default-member-avatar.png` from core
- moved default avatar url to `{site}/assets/default-member-avatar.png`
- use `servePublicFile` middleware after the `staticTheme` middleware as a simpler fallback to the default public image if the theme asset image doesn't exist
- dropped specialised member avatar middleware and now-unused `ActiveTheme.hasFile` method
member.avatar_image for gravatar with customisable fallback imagemember.avatar_image for member gravatar usage in front-end
kevinansfield
force-pushed
the
member-gravatar
branch
from
February 17, 2020 14:01
88f5ada to
7762a30
Compare
kevinansfield
force-pushed
the
member-gravatar
branch
from
February 17, 2020 14:14
7762a30 to
7639cb6
Compare
kevinansfield
marked this pull request as ready for review
February 17, 2020 14:15
kevinansfield
requested review from
daniellockyer,
naz and
rshbhgrg
and removed request for
daniellockyer,
naz and
rshbhgrg
February 19, 2020 10:07
peterzimon
added a commit
to TryGhost/Lyra
that referenced
this pull request
Feb 19, 2020
refs: TryGhost/Product#243 TryGhost/Ghost#11584 - uses `@member.avatar_image` attribute to show Gravatars on account page and site navigation - falls back to theme's default avatar icon if logged in member doesn't have a Gravatar
daniellockyer
added a commit
that referenced
this pull request
Feb 24, 2020
* master: (24 commits) Version bump to 3.8.0 Updated Ghost-Admin to 3.8.0 🐛 Fixed incorrect email count on post publish (#11616) Update dependency @sentry/node to v5.12.4 Handled missing resource path for resized images Added migration to add members.geolocation Allowed editing member's email Added missing frame parameter in member mapper Added "trust proxy" to members API app Removed unused cpy-cli dependency Refactored variable name to match intent Fixed use of deprecated function in test suite Combined Ghost-CLI tests into one GitHub Action job Update dependency mysql to v2.18.1 Added `created_at` field to accepted fields for members CSV import Fixed member API regression tests ✨ Added `member.avatar_image` for member gravatars in themes (#11584) Enabled full test suite on Renovate PRs Revert "Update dependency grunt-mocha-cli to v5" Update dependency grunt-mocha-cli to v5 ...
pull Bot
pushed a commit
to YashRajCodes/Ghost
that referenced
this pull request
Jul 20, 2026
…t#11584) refs TryGhost/Product#243 - uses `member.toJSON()` to add a computed `avatar_image` property - if the member has an email address and gravatar is not disabled then we generate a gravatar url using the `?d=blank` parameter to return a transparent image if the member's email has no gravatar
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.
refs https://github.com/TryGhost/Team/issues/243
member.toJSON()to add a computedavatar_imageproperty?d=blankparameter to return a transparent image if the member's email has no gravatarTODO:
/content/images/members/avatar/default/was originally chosen because it would allow fallback for individual member images using the UUID but that's not necessary becausemember.avatar_imagecan be set directly to an uploaded image URL if one exists?d=param states "MUST NOT include a querystring (if it does, it will be ignored)")