.PHONY: local build compress upload clean build: hugo compress: @dir_path="./public"; \ ignored=0; \ compressed=0; \ for file in $$(find "$$dir_path" -type f ! -name "*.gz"); do \ gzip -9nc "$$file" > "$${file}.test.gz"; \ if cmp -s "$${file}.gz" "$${file}.test.gz"; then \ rm "$${file}.test.gz"; \ ignored=$$((ignored+1)); \ else \ mv "$${file}.test.gz" "$${file}.gz"; \ compressed=$$((compressed+1)); \ echo "Compressed: $$file.gz"; \ fi; \ done; \ echo "Ignored $$ignored files. Total compressed: $$compressed." remove_exif: @dir_path="./assets/blog"; \ echo "a";\ for file in $$(find "$$dir_path" -type f \( -name "*.jpg" -or -name "*.JPEG" \)); do \ echo "EXIF cleared: $$file"; \ convert $$file -strip $$file; \ done; upload: source_dir="public/"; \ dest_server="mms@10.0.7.0:/usr/local/sites/site-crys"; \ rsync -irtvzP --delete "$$source_dir" "$$dest_server"; \ echo "Rsync completed." interlace_images: @dir_path="./public"; \ for file in $$(find "$$dir_path" -type f -name "*.jpg" -mtime -1); do \ convert $$file -interlace plane $$file; \ done; clean: rm -r public deploy: build upload