mirror of
https://github.com/LouisShark/chatgpt_system_prompt.git
synced 2025-07-05 14:20:33 -04:00
fix: rename all filename
This commit is contained in:
parent
3f5709af6b
commit
7f75b100c2
4 changed files with 5 additions and 33 deletions
|
@ -13,12 +13,14 @@ generate_toc() {
|
|||
local title=$(basename "$file" .md)
|
||||
# Replace Windows incompatible characters with '_'
|
||||
local safe_title=$(echo "$title" | sed 's/[<>::"\/\\|?*]/_/g')
|
||||
# Rename the source file with the safe_title
|
||||
mv "$file" "$dir/$safe_title.md"
|
||||
# shellcheck disable=SC2001
|
||||
local link=$(echo "$file" | sed "s|^$base_dir/||")
|
||||
local link=$(echo "$dir/$safe_title.md" | sed "s|^$base_dir/||")
|
||||
local encoded_link=$(python -c "import urllib.parse; print(urllib.parse.quote('''$link'''))")
|
||||
echo " - [$safe_title]($encoded_link)"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
generate_toc .
|
||||
generate_toc .
|
Loading…
Add table
Add a link
Reference in a new issue