Skip to content

Commit faa6570

Browse files
authored
支持多语言
1 parent 73d0af0 commit faa6570

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

scripts/build.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,21 @@ for config in ./_config.*.yml; do
2727
cp "$file" "$target"
2828
fi
2929
done
30+
find src -type f -name "*.json" ! -name "*.*.json" | while read -r file; do
31+
target="${file%.json}.$language.json"
32+
if [ ! -f "$target" ]; then
33+
cp "$file" "$target"
34+
fi
35+
done
3036
fi
3137
bundle exec jekyll build --trace --verbose --destination "_site_$language" --config "_config.yml,_config.$language.yml"
3238
cd "_site_$language"
3339
if [ "$language" != "default" ]; then
3440
find . -type f -name "*.$language.html" -exec cp --parents {} ../_site \;
41+
find . -type f -name "*.$language.json" -exec cp --parents {} ../_site \;
3542
else
3643
find . -type f -name "*.html" -exec cp --parents {} ../_site \;
44+
find . -type f -name "*.json" -exec cp --parents {} ../_site \;
3745
fi
3846
cd ..
3947
rm -rf "_site_$language"

0 commit comments

Comments
 (0)