1
0
web-semprace/delete_pages.sh
Filip Rojek f4c7bfd959 Added: sitemap.xml, robots.txt
Fixed: Removing unwanted pages for each post
2023-12-18 05:41:28 +01:00

21 lines
480 B
Bash
Executable File

#!/bin/bash
content_dir="./content"
public_dir="./public"
cp "$sitemap_file" "$temp_sitemap_file"
for file in "$content_dir"/*; do
file_name=$(basename "$file")
folder_name="${file_name%.*}"
folder_name_dashed=$(echo "$folder_name" | tr '_' '-')
folder_path="$public_dir/$folder_name_dashed"
if [ -d "$folder_path" ]; then
rm -r "$folder_path"
echo "Removed: $folder_path"
else
echo "Folder not found: $folder_path"
fi
done