From 0caec46b01fb52c68c2cf1f4413fce43fb0cff36 Mon Sep 17 00:00:00 2001 From: zaimon <> Date: Fri, 6 Dec 2024 18:28:06 +0530 Subject: [PATCH] fixed ltximg relative link lighttpd problem --- create.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/create.sh b/create.sh index 0b12e1a..86459b8 100755 --- a/create.sh +++ b/create.sh @@ -4,4 +4,25 @@ emacs -Q --batch -l create-site.el rsync -avi ./content/ltximg ./public/cosmicflow-html/ + +# Set the source and destination directories +src_dir="./public/cosmicflow-html" +src_ltximg_dir="./public/cosmicflow-html/ltximg" + +# Loop through each subdirectory +for dir in "$src_dir"/*; do + if [ -d "$dir" ]; then + dir_name=$(basename "$dir") + dst_ltximg_dir="${src_dir}/${dir_name}/ltximg" + + # Create the destination subdirectory if it doesn't exist + if [ ! -d "$dst_ltximg_dir" ]; then + mkdir -p "$dst_ltximg_dir" + fi + + # Use rsync to copy files starting with the subdirectory name as prefix + rsync -av --include="$dir_name*" --exclude="*" "${src_ltximg_dir}/" "${dst_ltximg_dir}/" + fi +done + # rm -rf ./content/ltximg/