From edd997402b1f309158de25f19e559d81c1d67af6 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Fri, 19 Jun 2020 11:39:08 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Added=20`sizes`=20attribute=20to=20?= =?UTF-8?q?in-content=20``=20elements?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit no issue - by including `sizes` with media-queries that match typical content widths we can give the browser better hints as to which responsive image size to fetch resulting in more performant pages - also fixes `srcset` output where "unknown" sizes were used instead of linking to the original image src which was causing 302 redirects and slowing image loading in some cases --- package.json | 2 +- test/unit/lib/mobiledoc_spec.js | 4 ++-- yarn.lock | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 6f609c2a92..38e156465a 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "@tryghost/image-transform": "0.2.4", "@tryghost/kg-card-factory": "2.1.1", "@tryghost/kg-default-atoms": "2.0.1", - "@tryghost/kg-default-cards": "2.2.1", + "@tryghost/kg-default-cards": "2.3.1", "@tryghost/kg-markdown-html-renderer": "2.0.1", "@tryghost/kg-mobiledoc-html-renderer": "3.0.1", "@tryghost/magic-link": "0.4.9", diff --git a/test/unit/lib/mobiledoc_spec.js b/test/unit/lib/mobiledoc_spec.js index 32ce7d2e82..51253605a2 100644 --- a/test/unit/lib/mobiledoc_spec.js +++ b/test/unit/lib/mobiledoc_spec.js @@ -76,7 +76,7 @@ describe('lib/mobiledoc', function () { }; mobiledocLib.mobiledocHtmlRenderer.render(mobiledoc) - .should.eql('

One
Two

Markdown card

\n

Some markdown

\n

Three


Birdies

Four

HTML card

\n

Some HTML

Embed card

'); + .should.eql('

One
Two

Markdown card

\n

Some markdown

\n

Three


Birdies

Four

HTML card

\n

Some HTML

Embed card

'); }); it('respects srcsets config', function () { @@ -111,7 +111,7 @@ describe('lib/mobiledoc', function () { }; mobiledocLib.mobiledocHtmlRenderer.render(mobiledoc) - .should.eql('
Birdies
'); + .should.eql('
Birdies
'); }); }); diff --git a/yarn.lock b/yarn.lock index 54f9c5e169..016cf7a119 100644 --- a/yarn.lock +++ b/yarn.lock @@ -443,10 +443,10 @@ resolved "https://registry.yarnpkg.com/@tryghost/kg-default-atoms/-/kg-default-atoms-2.0.1.tgz#3223ef5210d73af02c53795e5a5f1a9c5fc5bd92" integrity sha512-0/Fx98ZIj/gyPglKg9HQP+cKPSBpbue1pnzh3E8hR4WXzqnSWMFA8VTUyMeI+8oNwxkxhZrWt5KifngHbBfw2A== -"@tryghost/kg-default-cards@2.2.1": - version "2.2.1" - resolved "https://registry.yarnpkg.com/@tryghost/kg-default-cards/-/kg-default-cards-2.2.1.tgz#e7ab335f85bcbb714c268c30c21ffe3d8edef557" - integrity sha512-fUGn63XHmR6IoFu3O6sB9H8ozKjNpvGLmq6do8Y/2+XNmfXcGpu4mBvbrsz5dZ7SIPzkeDVJtKp9PcMjM/oCzw== +"@tryghost/kg-default-cards@2.3.1": + version "2.3.1" + resolved "https://registry.yarnpkg.com/@tryghost/kg-default-cards/-/kg-default-cards-2.3.1.tgz#d3eb1f180cab7a56433f17e603e00fa2fc105366" + integrity sha512-k5wJvWr2Xx6NOdSiaPmTihLCo7QJCvzFLe2kEskc4fn9u/YzZWQCQfmJVKNrsQ7MG8V06z8uOcXBUsQY3/4uGQ== dependencies: "@tryghost/kg-markdown-html-renderer" "^2.0.1" "@tryghost/url-utils" "^0.6.14"