From a44460d226b999c627f02a72782d01a6577d161f Mon Sep 17 00:00:00 2001 From: Rishabh Date: Mon, 25 Jul 2022 21:47:30 +0530 Subject: [PATCH] =?UTF-8?q?=E2=84=B9=EF=B8=8F=20=20Updated=20default=20con?= =?UTF-8?q?fig=20and=20CDN=20for=20frontend=20apps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refs https://github.com/TryGhost/Team/issues/1719 - switches default CDN from unpkg to jsDelivr for better reliability - current config for frontend apps doesn't allow easy switching of CDN for frontend urls - allows easy switch of base CDN for frontend apps via config - fixes double use of version string in the config - extends config to include url needed for loading styles for frontend app instead of hardcoded urs --- ghost/core/core/shared/config/defaults.json | 16 +++++++++------- .../core/shared/config/env/config.testing.json | 5 +++-- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/ghost/core/core/shared/config/defaults.json b/ghost/core/core/shared/config/defaults.json index e568178a0e..56712c3f95 100644 --- a/ghost/core/core/shared/config/defaults.json +++ b/ghost/core/core/shared/config/defaults.json @@ -133,12 +133,18 @@ "emailAnalytics": true }, "portal": { - "url": "https://unpkg.com/@tryghost/portal@~2.3.0/umd/portal.min.js", + "url": "https://cdn.jsdelivr.net/npm/@tryghost/portal@~{version}/umd/portal.min.js", "version": "2.3" }, "sodoSearch": { - "url": "https://unpkg.com/@tryghost/sodo-search@~1.0.0/umd/sodo-search.min.js", - "version": "1.0.0" + "url": "https://cdn.jsdelivr.net/npm/@tryghost/sodo-search@~{version}/umd/sodo-search.min.js", + "styles": "https://cdn.jsdelivr.net/npm/@tryghost/sodo-search@~{version}/umd/main.css", + "version": "1.0" + }, + "comments": { + "url": "https://cdn.jsdelivr.net/npm/@tryghost/comments-ui@~{version}/umd/comments-ui.min.js", + "styles": "https://cdn.jsdelivr.net/npm/@tryghost/comments-ui@~{version}/umd/main.css", + "version": "0.1" }, "editor": { "url": "" @@ -155,9 +161,5 @@ }, "gravatar": { "url": "https://www.gravatar.com/avatar/{hash}?s={size}&r={rating}&d={_default}" - }, - "comments": { - "url": "https://unpkg.com/@tryghost/comments-ui@~0.1.0/umd/comments-ui.min.js", - "version": "0.1.0" } } diff --git a/ghost/core/core/shared/config/env/config.testing.json b/ghost/core/core/shared/config/env/config.testing.json index 869d1359b6..b1cc05964a 100644 --- a/ghost/core/core/shared/config/env/config.testing.json +++ b/ghost/core/core/shared/config/env/config.testing.json @@ -56,7 +56,8 @@ "urlCache": "test/utils/fixtures/urls" }, "sodoSearch": { - "url": "https://unpkg.com/@tryghost/sodo-search@~0.1.0/umd/sodo-search.min.js", - "version": "0.1.0" + "url": "https://cdn.jsdelivr.net/npm/@tryghost/sodo-search@~{version}/umd/sodo-search.min.js", + "styles": "https://cdn.jsdelivr.net/npm/@tryghost/sodo-search@~{version}/umd/main.css", + "version": "1.0" } }