-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
54 lines (35 loc) · 1.12 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
SITE = "src/site-dev.yml"
SHELL := /bin/bash
RELEASE_HOST ?= https://raw.githubusercontent.com/kiprotect/
all: site
export PATH := $(PATH):$(HOME)/.local/bin
setup: virtualenv requirements
virtualenv:
virtualenv --python python3 venv
requirements:
venv/bin/pip install -r requirements.txt
npm ci
sass:
node_modules/.bin/node-sass src/assets/scss/main.scss src/static/css/main.css
babel:
node_modules/.bin/babel src/**/*.es6 --out-dir "."
translate:
@if [ -n "$(TOKEN)" ]; then venv/bin/beam i18n translate $(TOKEN) src $(TA); fi;
translate-config:
@if [ ! -n "$(TOKEN)" ]; then echo "Please set the translation token as the TOKEN variable." && exit 1; fi;
venv/bin/beam i18n translate-config $(TOKEN) src $(TA)
downloads:
curl $(RELEASE_HOST)klaro/master/releases.yml > src/en/releases.yml
optimize: optimize-images optimize-html
optimize-images:
find src -name "*.png" -exec optipng {} \;
optimize-html:
find build -name "*.html" -exec tidy -m {} \;
site: translate sass babel downloads
venv/bin/beam -vv up --site $(SITE)
clean:
rm -rf build/*
serve:
python3 -m http.server -d build 8112
watch: site
./watch.sh