diff --git a/README.md b/README.md
index bf5e2f0e..32248179 100644
--- a/README.md
+++ b/README.md
@@ -29,7 +29,7 @@ This project is aim to make you better understand how the type system works, wri
> Click the following badges to see detail of the challenges!
-
+
## Recommended Readings
diff --git a/README.zh-CN.md b/README.zh-CN.md
index dc11a0c7..f62d4e6c 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -30,7 +30,7 @@ TypeScript 类型体操姿势合集
> 点击下方徽章查看题目内容
-
+
## 推荐读物
diff --git a/scripts/readme.ts b/scripts/readme.ts
index 85a63bb1..cbeee85b 100644
--- a/scripts/readme.ts
+++ b/scripts/readme.ts
@@ -50,8 +50,8 @@ function toDifficultyBadge(difficulty: string, locale: SupportedLocale) {
return toBadge('', t(locale, `difficulty.${difficulty}`), DifficultyColors[difficulty])
}
-function toDifficultyBadgeInverted(difficulty: string, locale: SupportedLocale) {
- return toBadge(t(locale, `difficulty.${difficulty}`), ' ', DifficultyColors[difficulty])
+function toDifficultyBadgeInverted(difficulty: string, locale: SupportedLocale, count: number) {
+ return toBadge(t(locale, `difficulty.${difficulty}`), count.toString(), DifficultyColors[difficulty])
}
function quizToBadge(quiz: Quiz, locale: string) {
@@ -101,7 +101,7 @@ async function insertInfoReadme(filepath: string, quiz: Quiz, locale: SupportedL
const info = resolveInfo(quiz, locale)
- const avaliableLocales = supportedLocales.filter(l => l !== locale).filter(l => !!quiz.readme[l])
+ const availableLocales = supportedLocales.filter(l => l !== locale).filter(l => !!quiz.readme[l])
text = text
.replace(
@@ -111,7 +111,7 @@ async function insertInfoReadme(filepath: string, quiz: Quiz, locale: SupportedL
+ `
` + '${toAuthorInfo(info.author)}
' + toBadgeLink(toPlayShort(quiz.no, locale), '', t(locale, 'badge.take-the-challenge'), '3178c6', '?logo=typescript') - + (avaliableLocales.length ? (' ' + avaliableLocales.map(l => toBadgeLink(toNearborREADME(quiz, l), '', t(l, 'display'), 'gray')).join(' ')) : '') + + (availableLocales.length ? (' ' + availableLocales.map(l => toBadgeLink(toNearborREADME(quiz, l), '', t(l, 'display'), 'gray')).join(' ')) : '') + '
' + '', ) @@ -140,9 +140,10 @@ async function updateIndexREADME(quizes: Quiz[]) { // Difficulty const quizesByDifficulty = [...quizes].sort((a, b) => DifficultyRank.indexOf(a.difficulty) - DifficultyRank.indexOf(b.difficulty)) + for (const quiz of quizesByDifficulty) { if (prev !== quiz.difficulty) - challengesREADME += `${prev ? '