fixed the same relative link issue for pics

This commit is contained in:
zaimon 2024-12-06 18:47:18 +05:30
parent 0caec46b01
commit 854f314b53
3 changed files with 23 additions and 1 deletions

View file

@ -1,5 +1,6 @@
#!/usr/bin/env sh
rm -rf ./public/cosmicflow-html/
# generate the html and gemini versions of the site using org-publish
emacs -Q --batch -l create-site.el
@ -25,4 +26,25 @@ for dir in "$src_dir"/*; do
fi
done
# Set the source and destination directories
src_dir="./public/cosmicflow-html"
src_pics_dir="./assets/pics/"
# Loop through each subdirectory
for dir in "$src_dir"/*; do
if [ -d "$dir" ]; then
dir_name=$(basename "$dir")
dst_pics_dir="${src_dir}/${dir_name}/pics"
# Create the destination subdirectory if it doesn't exist
if [ ! -d "$dst_pics_dir" ]; then
mkdir -p "$dst_pics_dir"
fi
# Use rsync to copy files starting with the subdirectory name as prefix
rsync -av --include="$dir_name*" --exclude="*" "${src_pics_dir}/" "${dst_pics_dir}/"
fi
done
# rm -rf ./content/ltximg/