mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-19 08:31:43 +03:00
b7f3892be0
fixes https://github.com/TryGhost/Ghost/issues/14323 - Fixed support for resizing images from Unsplash using the `img-url` helper (previously the size property was ignored for images from Unsplash) - Added support for `avif` file formats (supported by sharp out of the box) - Added support for setting the format of images, with a new `format` option: E.g. to convert an image to webp (only works in combination with size for now, except for Unsplash where you can use it without size): ``` {{img_url @site.cover_image size="s" format="webp"}} ``` This can help improve the performance of a theme, by serving assets in `<picture>` elements with webp and fallback image formats. Usage example: ```html <picture> <source srcset="{{img_url feature_image size="s" format="avif"}} 300w, {{img_url feature_image size="m" format="avif"}} 600w, {{img_url feature_image size="l" format="avif"}} 1000w, {{img_url feature_image size="xl" format="avif"}} 2000w" sizes="(min-width: 1400px) 1400px, 92vw" type="image/avif" > <source srcset="{{img_url feature_image size="s" format="webp"}} 300w, {{img_url feature_image size="m" format="webp"}} 600w, {{img_url feature_image size="l" format="webp"}} 1000w, {{img_url feature_image size="xl" format="webp"}} 2000w" sizes="(min-width: 1400px) 1400px, 92vw" type="image/webp" > <img srcset="{{img_url feature_image size="s"}} 300w, {{img_url feature_image size="m"}} 600w, {{img_url feature_image size="l"}} 1000w, {{img_url feature_image size="xl"}} 2000w" sizes="(min-width: 1400px) 1400px, 92vw" src="{{img_url feature_image size="xl"}}" alt="{{#if feature_image_alt}}{{feature_image_alt}}{{else}}{{title}}{{/if}}" > </picture> ``` |
||
---|---|---|
.. | ||
test_tpl | ||
asset.test.js | ||
authors.test.js | ||
body_class.test.js | ||
cancel_link.test.js | ||
comment_count.test.js | ||
comments.test.js | ||
concat.test.js | ||
content.test.js | ||
date.test.js | ||
encode.test.js | ||
excerpt.test.js | ||
facebook_url.test.js | ||
foreach.test.js | ||
get.test.js | ||
ghost_foot.test.js | ||
ghost_head.test.js | ||
has.test.js | ||
img_url.test.js | ||
is.test.js | ||
lang.test.js | ||
link_class.test.js | ||
link.test.js | ||
match.test.js | ||
meta_description.test.js | ||
meta_title.test.js | ||
navigation.test.js | ||
next_post.test.js | ||
page_url.test.js | ||
pagination.test.js | ||
plural.test.js | ||
post_class.test.js | ||
prev_post.test.js | ||
price.test.js | ||
raw.test.js | ||
reading_time.test.js | ||
t.test.js | ||
tags.test.js | ||
tiers.test.js | ||
title.test.js | ||
total_members.test.js | ||
total_paid_members.test.js | ||
twitter_url.test.js | ||
url.test.js |