This repository was archived by the owner on Nov 28, 2022. It is now read-only.
asset rewriting for default user image on setup#996
Merged
Conversation
- updated the placeholder image style due to it throwing a 404 error when going through ghost setup
Member
|
Hey @CriticalRespawn 👋 The correct fix here is the same as the fixes in cbcf09e - the template strings are tripping up the asset rewriter so we need to split out the local asset name. We'll be getting rid of custom CSS classes soon in favour of our Tachyons based framework so it's better to keep URLs in the JS. |
Author
|
Thanks @kevinansfield I'll take a look and try and get an updated pushed to this branch in the next few days 👍 |
…correctly on ghost setup
Author
|
Hi @kevinansfield 😄 I've changed this PR so it now contains the correct fix! |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
When setting up my local Ghost development environment, after I ran
grunt dev, I was getting"GET /ghost/assets/img/user-image.png" 404in terminal every time I viewed step 2 of the setup process.Upon further inspection, the image it was trying to find was
/ghost/assets/img/user-image.pngwhich didn't exactly match any other image during the setup process as the others had some sort of ID in them such asassets/img/install-welcome-3ae80f63d742f7376413a637c3d1b21f.png.By removing
style={{placeholderStyle}}and giving it a background URL within the CSS, the image is now successfully found as it's looking for/ghost/assets/img/user-image-feeb00c017f02c8915d6bc3ffdecf706.png- note that it now contains an ID, whereas it didn't before.Functionality appears to be fine, I've tested the different instances I could think of here and screenshot the results below.
Before:

After:

After (Gravatar):

After (Manual Upload):

I noticed that
placeholderStyleis defined in theapp/components/gh-profile-image.jsfile... I can't see any other usages of it so if this fix is okay, would it be wise to delete references to it in that file too?