summaryrefslogtreecommitdiff
path: root/Makefile
blob: 75e7f0fc7fe98e239a476995a6a1d2e720c31db6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
.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