-DOCKER_TAG="$(DOCKER_TAG)"
-CONTAINER_NAME="$(CONTAINER_NAME)"
-# default modules
-MODULES="php"
-
-all: builddirs npm_dependencies swig htmlmin min-css min-js copy-img submodules
-
-swig:
- $(NODE) node_modules/swig/bin/swig.js render -j dist.json templates/faq.swig > $(CURDIR)/build/faq.html
- $(NODE) node_modules/swig/bin/swig.js render -j dist.json templates/index.swig > $(CURDIR)/build/index.html
- $(NODE) node_modules/swig/bin/swig.js render -j dist.json templates/tools.swig > $(CURDIR)/build/tools.html
-
-htmlmin:
- $(NODE) node_modules/htmlmin/bin/htmlmin $(CURDIR)/build/index.html -o $(CURDIR)/build/index.html
- $(NODE) node_modules/htmlmin/bin/htmlmin $(CURDIR)/build/faq.html -o $(CURDIR)/build/faq.html
- $(NODE) node_modules/htmlmin/bin/htmlmin $(CURDIR)/build/tools.html -o $(CURDIR)/build/tools.html
+DOCKER_TAG = "$(DOCKER_TAG)"
+CONTAINER_NAME = "$(CONTAINER_NAME)"
+pageList = $(shell $(CURDIR)/$(NODEJQ) -r ".pages[]" $(CURDIR)/$(CONF))
+noExt = $(shell echo $(i) | cut -d '.' -f1)
+
+all: builddirs npm_dependencies ejs "node_modules/minify/bin/minify.js"-all copy-img copy-php
+
+ejs:
+ $(foreach i,$(pageList), \
+ "node_modules/ejs/bin/cli.js" -f $(CURDIR)/$(CONF) $(CURDIR)/src/templates/$(i) -o $(CURDIR)/build/html/unmin/$(noExt).html;)
+
+"node_modules/minify/bin/minify.js"-all:
+ "node_modules/minify/bin/minify.js" $(CURDIR)/src/static/js/uguu.js > $(CURDIR)/build/js/uguu.min.js
+ "node_modules/minify/bin/minify.js" $(CURDIR)/src/static/css/uguu.css > $(CURDIR)/build/css/uguu.min.css
+ "node_modules/minify/bin/minify.js" $(CURDIR)/build/html/unmin/faq.html > $(CURDIR)/build/html/min/faq.html
+ "node_modules/minify/bin/minify.js" $(CURDIR)/build/html/unmin/tools.html > $(CURDIR)/build/html/min/tools.html
+ "node_modules/minify/bin/minify.js" $(CURDIR)/build/html/unmin/index.html > $(CURDIR)/build/html/min/index.html