-
Notifications
You must be signed in to change notification settings - Fork 52
/
Makefile
49 lines (39 loc) · 987 Bytes
/
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
.DEFAULT_GOAL := dev
SERVER_OPTS ?= --baseURL=/ --appendPort=false
DEPS := node_modules
HUGO_OPTS ?=
.PHONY: dev
dev: $(DEPS)
hugo server -D -F --disableFastRender --bind=0.0.0.0 $(SERVER_OPTS)
deps:
brew reinstall node
brew install hugo
node_modules:
npm install
.PHONY: clean
clean:
rm -rf node_modules
.PHONY: build
build: $(DEPS)
hugo --gc --minify
.PHONY: prod-build
prod-build:
hugo --gc $(HUGO_OPTS)
CONTEXT="production" ./post-build.sh
.PHONY: prod-build-ipfs
prod-build-ipfs:
hugo --gc $(HUGO_OPTS)
./minify.sh
.PHONY: publish
publish:
@echo "done by netlify"
.PHONY: image-optim
image-optim:
set -e; for source in `find . -iname "*.jpg" -or -iname "*.jpeg" | grep -v min.`; do \
echo $$source; \
convert -resize '2000x2000>' -sampling-factor 4:2:0 -strip -quality 85 -interlace JPEG -colorspace RGB $$source `dirname $$source`/min.`basename $$source`; \
done
@# FIXME: do it for png too
.PHONY: netlify-dev
netlify-dev:
netlify dev -c 'make dev'