From 24ea893279388d66d108e1a1e8e37e3cf24717c5 Mon Sep 17 00:00:00 2001 From: Navyum <36869790+Navyum@users.noreply.github.com> Date: Sun, 18 Aug 2024 20:29:17 +0800 Subject: [PATCH] fix sitemap.sh when markdown title in chinese MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复markdown中文标题执行异常: ERROR: ./sitemap.sh: line 34: -3: substring expression < 0 --- docs/sitemap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sitemap.sh b/docs/sitemap.sh index ce5b70e..ff8ee8e 100755 --- a/docs/sitemap.sh +++ b/docs/sitemap.sh @@ -28,7 +28,7 @@ items="" for file in ${files[@]}; do [[ ${ignore[@]/${file}/} != ${ignore[@]} ]] && continue echo $file - encode=$(urlencode "${file::-3}") + encode=$(urlencode "${file%.*}") link="$website_link/#/$encode" date=$(git log -1 --format="%ad" --date="iso-strict-local" -- $file) item="