-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
20 lines (18 loc) · 657 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
all: images
hugo
server: images
hugo server --disableFastRender
images:
@find assets/images/ -type f -name "*.png" -or -name "*.jpg" -or -name "*.gif" | while read i; do \
if file $$i | grep -q "PNG image data"; then \
mv -fn $$i `dirname $$i`/`sha256sum $$i | grep -Po '^[a-f0-9]{64}'`.png; \
fi; \
if file $$i | grep -q "JPEG image data"; then \
mv -fn $$i `dirname $$i`/`sha256sum $$i | grep -Po '^[a-f0-9]{64}'`.jpg; \
fi; \
if file $$i | grep -q "GIF image data"; then \
mv -fn $$i `dirname $$i`/`sha256sum $$i | grep -Po '^[a-f0-9]{64}'`.gif; \
fi \
done
clean:
rm -rf public/ resources/