greenrivers / grav-plugin-webp

Grav Webp plugin.
MIT License
11 stars 0 forks source link

I can't reach my images after webp conversion #12

Closed paulettepaillette closed 8 months ago

paulettepaillette commented 8 months ago

Thanks for creating this plugin! I installed it, and converted my website images. They are now in the folder user > webp > user > pages > 03.project > 01.project-1 When I'm trying to display these images but it doesn't work. I tried this code to display every page media :

<ul>
    {% for image in page.media.images %}
        <li><img src="{{ image.url|webp }}" alt="{{ image.alt }}" class="projet-image" /></li>
     {% endfor %}
</ul>

How can I make it work with your plugin? Thanks

MajorKuprich commented 8 months ago

Hello @paulettepaillette,

At the first make sure that You met the requirements from the docs: https://github.com/greenrivers/grav-plugin-webp#requirements

Did You clear cache after convert images?

Could You provide info about:

Regards

paulettepaillette commented 8 months ago

Hello @MajorKuprich,

Thanks for your answer. The requirements seems ok : GD is enabled, webp and PHP Exif too. I'm not sure about the libwebp-dev.

I cleared the cache yes.

For the infos:

Regards

MajorKuprich commented 8 months ago

Hi @paulettepaillette,

Looks fine for me, thx for Your further details. In this case the only idea I have is access to Your project (for example repository in Github) to find out what's going wrong. I would run Your project on my local environment to make sure that everything is ok from the plugin side. If there are errors on my local environment related to my plugin I will try to fix them. Let me know if this okay for You.

Cheers :-)

paulettepaillette commented 8 months ago

Thanks a lot for your answer, that's so nice. I send you an invite to the gitub repository. I put it in private.

Have a great day 😊

MajorKuprich commented 8 months ago

Hello,

Found the :bug: On nested pages there was an invalid relative webp image url.

Example: on https://www.example.com/03.project/subcategory instead of https://www.example.com/user/webp/user/pages/03.project/test.webp there was invalid image path https://www.example.com/03.project/subcategory/user/webp/user/pages/03.project/test.webp.

Fixed in new release. Related commit: https://github.com/greenrivers/grav-plugin-webp/commit/93fff0af1df0f7ca72790338d7f389f28dd2f921.

Please confirm it's working right. :-)

paulettepaillette commented 8 months ago

Hello @MajorKuprich,

It works perfectly, thanks! I have great performance on my website thanks to your plugin, so cool.

Have a great day 😊