chore: use jsDelivr for raw files

This commit is contained in:
Anthony Fu 2020-11-23 00:50:01 +08:00
parent bc4c1d955b
commit 80a7a28d1c

View File

@ -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) {