Skip to content

Commit d49982b

Browse files
committed
Update dish difficulty titles to use Chinese characters
1 parent d1eb29c commit d49982b

File tree

8 files changed

+309
-309
lines changed

8 files changed

+309
-309
lines changed

.github/readme-generate.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -103,20 +103,20 @@ async function organizeByStars(dishesFolder, starsystemFolder) {
103103

104104
await processFolder(dishesFolderAbs);
105105

106-
const starRatings = Array.from(new Set(Object.values(dishes))).sort((a, b) => b - a);
106+
const starRatings = Array.from(new Set(Object.values(dishes))).sort((a, b) => a - b);
107107
const navigationLinks = [];
108108

109109
for (const stars of starRatings) {
110110
const starsFile = path.join(starsystemFolderAbs, `${stars}Star.md`);
111-
const content = [`# Dishes with ${stars} Stars`, ''];
111+
const content = [`# ${stars} 星难度菜品`, ''];
112112
for (const [filepath, starCount] of Object.entries(dishes)) {
113113
if (starCount === stars) {
114114
const relativePath = path.relative(starsystemFolderAbs, filepath).replace(/\\/g, '/');
115115
content.push(`* [${path.basename(filepath, '.md')}](./${relativePath})`);
116116
}
117117
}
118118
await writeFile(starsFile, content.join('\n'), 'utf-8');
119-
navigationLinks.push(`- [${stars} Star Dishes](${path.relative(path.dirname(README_PATH), starsFile).replace(/\\/g, '/')})`);
119+
navigationLinks.push(`- [${stars} 星难度](${path.relative(path.dirname(README_PATH), starsFile).replace(/\\/g, '/')})`);
120120
}
121121

122122
return navigationLinks;
@@ -180,15 +180,16 @@ async function main() {
180180

181181
const navigationLinks = await organizeByStars(dishesFolder, starsystemFolder);
182182
// Debug logging to ensure navigationLinks is defined and contains data
183-
console.log("Navigation Links:", navigationLinks);
184-
const navigationSection = `\n## Navigation\n\n${navigationLinks.join('\n')}`;
183+
console.log("难度索引", navigationLinks);
184+
const navigationSection = `\n### 按难度索引\n\n${navigationLinks.join('\n')}`;
185185

186186
await writeFile(
187187
README_PATH,
188188
README_TEMPLATE
189189
.replace('{{before}}', README_BEFORE.trim())
190+
.replace('{{index_stars}}', navigationSection.trim())
190191
.replace('{{main}}', README_MAIN.trim())
191-
.replace('{{after}}', README_AFTER.trim())+ navigationSection,
192+
.replace('{{after}}', README_AFTER.trim()),
192193
);
193194

194195
await writeFile(

.github/templates/readme_template.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
## 本地部署
1717

18-
如果需要在本地部署菜谱 Web 服务,可以在安装 Docker 后运行下面命令:
18+
如果需要在本地部署菜谱 Web 服务,可以在安装 Docker 后运行下面命令:
1919

2020
```bash
2121
docker pull ghcr.io/anduin2017/how-to-cook:latest
@@ -36,7 +36,7 @@ docker run -d -p 5000:5000 ghcr.io/anduin2017/how-to-cook:latest
3636

3737
## 菜谱
3838

39-
### 家常菜
39+
{{index_stars}}
4040

4141
{{main}}
4242

README.md

+295-296
Large diffs are not rendered by default.

starsystem/1Star.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Dishes with 1 Stars
1+
# 1 星难度菜品
22

33
* [吐司果酱](./../dishes/breakfast/吐司果酱.md)
44
* [微波炉荷包蛋](./../dishes/breakfast/微波炉荷包蛋.md)

starsystem/2Star.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Dishes with 2 Stars
1+
# 2 星难度菜品
22

33
* [白灼虾](./../dishes/aquatic/白灼虾/白灼虾.md)
44
* [蒜蓉虾](./../dishes/aquatic/蒜蓉虾/蒜蓉虾.md)

starsystem/3Star.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Dishes with 3 Stars
1+
# 3 星难度菜品
22

33
* [干煎阿根廷红虾](./../dishes/aquatic/干煎阿根廷红虾/干煎阿根廷红虾.md)
44
* [微波葱姜黑鳕鱼](./../dishes/aquatic/微波葱姜黑鳕鱼.md)

starsystem/4Star.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Dishes with 4 Stars
1+
# 4 星难度菜品
22

33
* [咖喱炒蟹](./../dishes/aquatic/咖喱炒蟹.md)
44
* [小龙虾](./../dishes/aquatic/小龙虾/小龙虾.md)

starsystem/5Star.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Dishes with 5 Stars
1+
# 5 星难度菜品
22

33
* [戚风蛋糕](./../dishes/dessert/戚风蛋糕/戚风蛋糕.md)
44
* [芋泥雪媚娘](./../dishes/dessert/芋泥雪媚娘/芋泥雪媚娘.md)

0 commit comments

Comments
 (0)