From d8773dcc451dc82ba607aee2485662a0b32ae472 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Fri, 5 Jun 2020 17:27:01 +0100 Subject: [PATCH] Allowed bookmark cards to be created without a description no issue - title+description was too limiting for some sites so we're relaxing the requirements to only require a title --- core/server/api/canary/oembed.js | 2 +- package.json | 4 +-- yarn.lock | 48 +++++++++++++++++++++++++------- 3 files changed, 41 insertions(+), 13 deletions(-) diff --git a/core/server/api/canary/oembed.js b/core/server/api/canary/oembed.js index c6eedc5bea..71f952eeb1 100644 --- a/core/server/api/canary/oembed.js +++ b/core/server/api/canary/oembed.js @@ -38,7 +38,7 @@ async function fetchBookmarkData(url, html) { delete metadata.image; delete metadata.logo; - if (metadata.title && metadata.description) { + if (metadata.title) { return Promise.resolve({ type: 'bookmark', url, diff --git a/package.json b/package.json index 2e801b7cbf..85a8860d6c 100644 --- a/package.json +++ b/package.json @@ -46,9 +46,9 @@ "@tryghost/errors": "0.2.0", "@tryghost/helpers": "1.1.27", "@tryghost/image-transform": "0.2.4", - "@tryghost/kg-card-factory": "1.0.3", + "@tryghost/kg-card-factory": "2.0.0", "@tryghost/kg-default-atoms": "1.0.0", - "@tryghost/kg-default-cards": "1.2.2", + "@tryghost/kg-default-cards": "2.0.0", "@tryghost/kg-markdown-html-renderer": "1.0.4", "@tryghost/kg-mobiledoc-html-renderer": "2.0.1", "@tryghost/members-api": "0.20.0", diff --git a/yarn.lock b/yarn.lock index ff4b30001a..4b6f42ab81 100644 --- a/yarn.lock +++ b/yarn.lock @@ -428,10 +428,10 @@ optionalDependencies: sharp "0.25.3" -"@tryghost/kg-card-factory@1.0.3": - version "1.0.3" - resolved "https://registry.yarnpkg.com/@tryghost/kg-card-factory/-/kg-card-factory-1.0.3.tgz#39f18a77fdd178a27b513028b71e5d547639480d" - integrity sha512-EoxAA2fE+n9JyvsCSVnsNRyV44D7jT8ArbQeIl+2g/yA8GhRicKzsiR+xU1jnM6OWW3PNp8Pbnse4LhuoIWJqA== +"@tryghost/kg-card-factory@2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@tryghost/kg-card-factory/-/kg-card-factory-2.0.0.tgz#1fc651f132a5adc7b053987f2df5d9ec181865f9" + integrity sha512-i8CoC4kBR6OOYMzIqSHBC5PgT6RVl48FjOQcCo1A6965ez+1SUIKVjAXHKbNs4xvAtSY64GMXkJAd+FWoqz2Cw== "@tryghost/kg-clean-basic-html@^0.1.8": version "0.1.8" @@ -443,15 +443,15 @@ resolved "https://registry.yarnpkg.com/@tryghost/kg-default-atoms/-/kg-default-atoms-1.0.0.tgz#d423a0f19a6989051bd6bbc9c8f104c88bd5c738" integrity sha512-f6a8zIoL2w7aeZbeBj+0UPvFzE1Dd/zf3RGO+L4j/Kb4Z/yqOtoBWQun6I2H37XXoaqiiQc6Z3eW+L4iYSw1Ow== -"@tryghost/kg-default-cards@1.2.2": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@tryghost/kg-default-cards/-/kg-default-cards-1.2.2.tgz#711c72b37abbe796ad7d1969dd44ce4dfdb8defc" - integrity sha512-jC+zhwhKVb38UAck53H0l+CeSIzBM+R4n4p1Djc1SD+YtPdGedB0pGIoJYk0VL4FIje0T1akWy2Yxbte93gxrQ== +"@tryghost/kg-default-cards@2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@tryghost/kg-default-cards/-/kg-default-cards-2.0.0.tgz#34180131dba5fb2b1aa9aee230ff63a7d57ef803" + integrity sha512-GoG3ypOgFQkCFzh+Zgnyd3raRy+XsvikMw0EfaJ3qRrpQrJmQ+U+AGozUy3xKFfkTP+XnRpC00tglFKR4tC2aA== dependencies: - "@tryghost/kg-markdown-html-renderer" "^1.0.4" + "@tryghost/kg-markdown-html-renderer" "^2.0.0" "@tryghost/url-utils" "^0.6.14" -"@tryghost/kg-markdown-html-renderer@1.0.4", "@tryghost/kg-markdown-html-renderer@^1.0.4": +"@tryghost/kg-markdown-html-renderer@1.0.4": version "1.0.4" resolved "https://registry.yarnpkg.com/@tryghost/kg-markdown-html-renderer/-/kg-markdown-html-renderer-1.0.4.tgz#380c3b485625863a73e675495e53458fc1cc7e1e" integrity sha512-I2CVbnE00ZQc4K9ptbAKTGM3FfwSiJxMeXA52QGjRGVyPICFyw4BVLe9gUFDRradDjkVty63Jl72H6KDtrQd0Q== @@ -461,6 +461,16 @@ markdown-it-lazy-headers "^0.1.3" markdown-it-mark "^3.0.0" +"@tryghost/kg-markdown-html-renderer@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@tryghost/kg-markdown-html-renderer/-/kg-markdown-html-renderer-2.0.0.tgz#a54e571dff69aa25a4af4345fd290eb7f60848a9" + integrity sha512-bIh0te/NBgb9ZP12a6CDYQR92zD7mFINNW8MJEleYQEinJT38PSRborKDtcXID4yTVCY44n2ux5FnSSFi1XChg== + 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@2.0.1": version "2.0.1" resolved "https://registry.yarnpkg.com/@tryghost/kg-mobiledoc-html-renderer/-/kg-mobiledoc-html-renderer-2.0.1.tgz#163eb693d6d3d4f6d1747ba13cd95acb5b912fcd" @@ -5515,6 +5525,13 @@ linkify-it@^2.0.0: dependencies: uc.micro "^1.0.1" +linkify-it@^3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-3.0.2.tgz#f55eeb8bc1d3ae754049e124ab3bb56d97797fb8" + integrity sha512-gDBO4aHNZS6coiZCKVhSNh43F9ioIL4JwRjLZPkoLIY4yZFwg264Y5lu2x6rb1Js42Gh6Yqm2f6L2AJcnkzinQ== + dependencies: + uc.micro "^1.0.1" + livereload-js@^2.3.0: version "2.4.0" resolved "https://registry.yarnpkg.com/livereload-js/-/livereload-js-2.4.0.tgz#447c31cf1ea9ab52fc20db615c5ddf678f78009c" @@ -5861,6 +5878,17 @@ markdown-it@^10.0.0: mdurl "^1.0.1" uc.micro "^1.0.5" +markdown-it@^11.0.0: + version "11.0.0" + resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-11.0.0.tgz#dbfc30363e43d756ebc52c38586b91b90046b876" + integrity sha512-+CvOnmbSubmQFSA9dKz1BRiaSMV7rhexl3sngKqFyXSagoA3fBdJQ8oZWtRy2knXdpDXaBw44euz37DeJQ9asg== + dependencies: + argparse "^1.0.7" + entities "~2.0.0" + linkify-it "^3.0.1" + mdurl "^1.0.1" + uc.micro "^1.0.5" + markdown-table@^1.1.0: version "1.1.3" resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-1.1.3.tgz#9fcb69bcfdb8717bfd0398c6ec2d93036ef8de60"