-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
55 lines (38 loc) · 1.08 KB
/
Makefile
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
.PHONY: all deploy build serv upload optimize pin clean nuke
.SECONDARY:
DEPLOYER ?= aureooms
HUGO := hugo --gc
THEMES := $(shell find themes -type f -print)
STATIC := $(shell find static -type f -print)
CONTENT := $(shell find content -type f -print)
IMAGES_KEY := $(shell sh .bin/list-images config.yml)
IMAGES_SRC := $(addprefix .cache/src/,$(IMAGES_KEY))
IMAGES_SMA := $(addprefix .cache/sma/,$(IMAGES_KEY))
IMAGES_OPT := $(addprefix .cache/opt/,$(IMAGES_KEY))
all: build
build: public
deploy: clean build upload
serv:
$(HUGO) server
public: config.yml $(THEMES) $(STATIC) $(CONTENT)
$(HUGO)
upload:
scp -r public/. $(DEPLOYER)@resu5.ulb.ac.be:/home/web1343/public_html/
optimize: $(IMAGES_OPT)
@sh .bin/update-config config.yml $^
.cache/src/%:
@mkdir -p $(dir $@)
ipfs get $(notdir $@) -o $@
.cache/sma/%: .cache/src/%
@mkdir -p $(dir $@)
sh .bin/resize-image $< $@
.cache/opt/%: .cache/sma/%
@mkdir -p $(dir $@)
cp $< $@
sh .bin/optimize-image $@
pin: config.yml
@sh .bin/list-images $< | sh .bin/pin-images
clean:
rm -rf public
nuke: clean
rm -rf .cache resources