From 80a7a28d1c42b6a2713e20814f5b463fcfeee5dd Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Mon, 23 Nov 2020 00:50:01 +0800 Subject: [PATCH] chore: use jsDelivr for raw files --- scripts/toUrl.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/toUrl.ts b/scripts/toUrl.ts index 7fdb4849..8014b5fd 100644 --- a/scripts/toUrl.ts +++ b/scripts/toUrl.ts @@ -28,10 +28,11 @@ export function toQuizREADME(quiz: Quiz, locale?: string, absolute = false) { } export function toRawREADME(quiz: Quiz, locale?: string) { - const prefix = 'https://raw.githubusercontent.com/type-challenges/type-challenges/master' + const provider = 'https://cdn.jsdelivr.net/gh/type-challenges/type-challenges' + // const provider = 'https://raw.githubusercontent.com/type-challenges/type-challenges/master' return locale && locale !== defaultLocale && quiz.readme[locale] - ? `${prefix}/questions/${quiz.path}/README.${locale}.md` - : `${prefix}/questions/${quiz.path}/README.md` + ? `${provider}/questions/${quiz.path}/README.${locale}.md` + : `${provider}/questions/${quiz.path}/README.md` } export function toNearborREADME(quiz: Quiz, locale?: string) {