Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix images to properly create g-image components #21

Merged
merged 2 commits into from
Jul 25, 2020

Conversation

absentees
Copy link

Noticed in the starter site the images are plain old single <img> tags.

<img alt="Cover image" src="/images/uploads/sun-3713835_1920.jpg" class="post-card__image g-image">

image

After these changes:

<div class="post-card__header"><img alt="Cover image" src="/assets/static/sun-3713835_1920.81b85c1.d20ee42ad83e81611d99389b4b982ab3.jpg" data-src="/assets/static/sun-3713835_1920.81b85c1.d20ee42ad83e81611d99389b4b982ab3.jpg" data-srcset="/assets/static/sun-3713835_1920.81b85c1.d20ee42ad83e81611d99389b4b982ab3.jpg 770w" data-sizes="(max-width: 770px) 100vw, 770px" class="post-card__image g-image g-image--lazy g-image--loaded" srcset="/assets/static/sun-3713835_1920.81b85c1.d20ee42ad83e81611d99389b4b982ab3.jpg 770w" sizes="(max-width: 770px) 100vw, 770px" width="770"><noscript><img src="/assets/static/sun-3713835_1920.81b85c1.d20ee42ad83e81611d99389b4b982ab3.jpg" class="post-card__image g-image g-image--loaded" width="770" alt="Cover image"></noscript></div>

Lazy loading and all that now working.

The image paths look super messy with the ../../static but I cant find a better solution for now.

@suits-at
Copy link
Owner

suits-at commented Jul 13, 2020

Thanks for the PR @absentees. Have you tried editing the images via netlify cms after your change? I found an issue in the official starter blog template. In this issues it is mentioned, that editing the paths to relative paths breaks editing from the cms. If this is true, using relative paths is not really a solution for this issue.

@absentees
Copy link
Author

Thanks for the PR @absentees. Have you tried editing the images via netlify cms after your change? I found an issue in the official starter blog template. In this issues it is mentioned, that editing the paths to relative paths breaks editing from the cms. If this is true, using relative paths is not really a solution for this issue.

Yep i deployed to a new netlify site and tested uploading a new image. Using the new beta feature it sets the image paths correctly.

@suits-at suits-at merged commit 99f2284 into suits-at:master Jul 25, 2020
@suits-at
Copy link
Owner

I just merged your PR into master, and also tested it (https://netlifycms-gridsome.suits.at/) - seems to work. I am still not very happy with the relative paths but I guess it will do for now. At least we have proper g-images now... 😃 Thx again for the PR!

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.

2 participants