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

Resize doesn't work on the frontpage #26

Closed
floede opened this issue May 11, 2018 · 4 comments
Closed

Resize doesn't work on the frontpage #26

floede opened this issue May 11, 2018 · 4 comments

Comments

@floede
Copy link
Contributor

floede commented May 11, 2018

Hi!

I've just switched to using Haywire on my blog, but I have a problem.

Locally everything works fine, but in production my images on the frontpage are not resized.
They just keep their actual size which obviously breaks the design.

I can see that there's a function called "cropResize" being called on the images, but apparently that doesn't work.

Any ideas what could be going wrong?
I've installed Yarn and run the needed commands in the Haywire folder.

@robbinjohansson
Copy link
Owner

👋 Hi!

Wierd! If it's working locally my guess is that it would be an issue with your grav installation in production (not with the theme itself).

Have you installed all of grav's composer dependencies on your server? Maybe some package(s) is missing in your production environment. Hard to say without having the project in front of me, just guessing here 🕵️

The cropResize() function is built-in with grav media management. Haven't really used it very much myself.

I'm sorry I can't be of more help, have you tried asking in the grav slack channel? Maybe they can provide better help/information, I'll do some research myself, please let me know if you find a solution!

@floede
Copy link
Contributor Author

floede commented May 11, 2018

Thanks. I will look into that.

@floede
Copy link
Contributor Author

floede commented May 17, 2018

Hi!

So I've asked on the Grav Slack, and it turns out the syntax for you're using for cropResize is not quite the right one.

You have this:
{{ post.header.featured_image }}?cropResize=160,120">

But it's supposed to be this:

{{ page.media['sample-image.jpg'].cropResize(300, 300).html() }}

Apparently your syntax is meant for admin preview, but it's not efficient.

robbinjohansson added a commit that referenced this issue May 18, 2018
@robbinjohansson
Copy link
Owner

Fixed in #27 (b76ebfc). Thanks for your contribution @floede 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants