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

feat: add optional response images with cloudinary #80

Merged
merged 8 commits into from
Dec 13, 2022

Conversation

artis3n
Copy link
Contributor

@artis3n artis3n commented Dec 2, 2022

I was trying to adapt this to this theme and didn't see another option already available, so I thought you might like this PR. Let me know if this isn't the type of change you want to include in the theme.

This optionally provides a capability for responsive images via Cloudinary. It requires images to be hosted in Cloudinary (I have a free account for my blog). It does not add any weight if someone does not wish to use the feature. If they would like to use this, uncommenting cloudinary_cloud_name will load in the necessary javascript.

I am using it like this on my markdown articles:
image

Notably, the src path is the remote path in Cloudinary where my image is located, not a local path. This cloudinary configuration will also auto-select the best image type for the user's browser - e.g. AVIF or webp if supported, else png, jpg, etc. So a file extension is excluded from the path in my example.

The new meta tag addition to head.html is to gather mobile device dimensions so images can be properly sized in those cases.

.gitignore Show resolved Hide resolved
@gurusabarish
Copy link
Owner

Thanks for the pull request @artis3n ❤️

@gurusabarish gurusabarish merged commit 413eb0f into gurusabarish:master Dec 13, 2022
@artis3n
Copy link
Contributor Author

artis3n commented Dec 13, 2022

Thanks! Working through customizations I'm making on my site that require updates to the head or scripts template, so getting them into the theme where I can :)

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.

None yet

2 participants