From d08b586781b3715a68bdff023b34f21137e98dc6 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Mon, 19 Oct 2020 17:05:57 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20width/height=20attribute?= =?UTF-8?q?s=20in=20gallery=20cards=20not=20matching=20resized=20images?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes https://github.com/TryGhost/Ghost/issues/11548 - bumps @tryghost/kg-default-cards - introduces a breaking change where `imageOptimization` is passed as an options argument instead of separating out individual config options - fixes width/height attributes for images in gallery cards being larger than the max default width used when resizing images --- core/server/lib/mobiledoc.js | 3 +-- package.json | 2 +- yarn.lock | 22 ++++++++++++++++------ 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/core/server/lib/mobiledoc.js b/core/server/lib/mobiledoc.js index da7d2c8d5c..201e857a28 100644 --- a/core/server/lib/mobiledoc.js +++ b/core/server/lib/mobiledoc.js @@ -31,8 +31,7 @@ module.exports = { cardFactory = new CardFactory({ siteUrl: config.get('url'), - contentImageSizes: config.get('imageOptimization:contentImageSizes'), - srcsets: config.get('imageOptimization:srcsets'), + imageOptimization: config.get('imageOptimization'), canTransformImage(storagePath) { const {ext} = path.parse(storagePath); diff --git a/package.json b/package.json index b7b6b7d39a..ec96543492 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "@tryghost/job-manager": "0.1.1", "@tryghost/kg-card-factory": "2.1.2", "@tryghost/kg-default-atoms": "2.0.2", - "@tryghost/kg-default-cards": "2.6.1", + "@tryghost/kg-default-cards": "3.0.0", "@tryghost/kg-markdown-html-renderer": "2.0.2", "@tryghost/kg-mobiledoc-html-renderer": "3.0.1", "@tryghost/magic-link": "0.6.0", diff --git a/yarn.lock b/yarn.lock index a35f8bae89..554cea5703 100644 --- a/yarn.lock +++ b/yarn.lock @@ -461,17 +461,17 @@ resolved "https://registry.yarnpkg.com/@tryghost/kg-default-atoms/-/kg-default-atoms-2.0.2.tgz#b8a1143bb0fa559cd46a96181c91771a35a3547b" integrity sha512-cV9FcTatyyf6QgOgNJ56sZmxu+rj3W105owcJatGuNtMx4hWrKupnvzxt7HXNBlAzwNrct7m9trrDFk+ghj1xw== -"@tryghost/kg-default-cards@2.6.1": - version "2.6.1" - resolved "https://registry.yarnpkg.com/@tryghost/kg-default-cards/-/kg-default-cards-2.6.1.tgz#36a6b8f6bf68ec14e2d00848cd66faf2fbe06207" - integrity sha512-EsLqsW4b59M1B5PyAybVI6zaNY5EJQ/1IQBmw3eVLGY4yJURzkQbcNygZgQ/0xXtjC5zypHMJiYuvgalf63QMw== +"@tryghost/kg-default-cards@3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@tryghost/kg-default-cards/-/kg-default-cards-3.0.0.tgz#7357e5f30808cc73f012786c62ad519f2125140a" + integrity sha512-pnEPkbYrTXVdiiy/5X0Y1gWZORHk71jDiSGI+INd7mLSMqbzPYqCgPOdvsdLefi53GOy119Cu5s3+nNvC2ihFw== dependencies: - "@tryghost/kg-markdown-html-renderer" "^2.0.2" + "@tryghost/kg-markdown-html-renderer" "^2.0.3" "@tryghost/url-utils" "^0.6.14" handlebars "^4.7.6" juice "^7.0.0" -"@tryghost/kg-markdown-html-renderer@2.0.2", "@tryghost/kg-markdown-html-renderer@^2.0.2": +"@tryghost/kg-markdown-html-renderer@2.0.2": version "2.0.2" resolved "https://registry.yarnpkg.com/@tryghost/kg-markdown-html-renderer/-/kg-markdown-html-renderer-2.0.2.tgz#e52f44c02e1b9c3a7dfe2a4840f07a5af2e8717e" integrity sha512-gqGUEMQq/ZOCNfF2oBu1mGrGYfsh32ueG5zYj2jsYkzzWFgRZkaW7+zIMFCMtxeW3xKopYDQcCcwbiwP6R1afw== @@ -481,6 +481,16 @@ markdown-it-lazy-headers "^0.1.3" markdown-it-mark "^3.0.0" +"@tryghost/kg-markdown-html-renderer@^2.0.3": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@tryghost/kg-markdown-html-renderer/-/kg-markdown-html-renderer-2.0.3.tgz#895ea5f590bf80f6bb6cebb7aeb658f30fcf32f1" + integrity sha512-Vo1Kbi94YfPdaij8yF330I7CSu7ppdEcxAXm/7VTR0XHJRzBE7XGQwLNLzSaovb3R1BbQE1UKmIAknAFIGEkdg== + dependencies: + markdown-it "^11.0.0" + markdown-it-footnote "^3.0.2" + markdown-it-lazy-headers "^0.1.3" + markdown-it-mark "^3.0.0" + "@tryghost/kg-mobiledoc-html-renderer@3.0.1": version "3.0.1" resolved "https://registry.yarnpkg.com/@tryghost/kg-mobiledoc-html-renderer/-/kg-mobiledoc-html-renderer-3.0.1.tgz#b9aef8dec965f5f90eab8a530f44cc4e26cd305a"