hugo-coder-fork/Makefile

37 lines
812 B
Makefile
Raw Normal View History

2018-06-18 17:55:42 +00:00
# LESS params
2018-03-23 19:49:06 +00:00
LESS_DIR = ./static/less
LESS_FILE = style.less
2018-06-18 17:55:42 +00:00
LESS_RTL_FILE = style-rtl.less
# CSS params
2018-03-23 19:49:06 +00:00
CSS_DIR = ./static/css
CSS_FILE = style.min.css
2018-06-18 17:55:42 +00:00
CSS_RTL_FILE = style-rtl.min.css
2018-03-23 19:49:06 +00:00
CSS_TMP_FILE = tmp.css
2018-06-18 17:55:42 +00:00
define build_less
lessc $(LESS_DIR)/$(1) > $(CSS_DIR)/$(CSS_TMP_FILE)
uglifycss $(CSS_DIR)/$(CSS_TMP_FILE) > $(CSS_DIR)/$(2)
2018-03-23 19:49:06 +00:00
rm -f $(CSS_DIR)/$(CSS_TMP_FILE)
2018-06-18 17:55:42 +00:00
endef
.PHONY: clean demo build build-ltr build-rtl
build: clean build-ltr build-rtl
build-ltr:
$(call build_less,$(LESS_FILE),$(CSS_FILE))
build-rtl:
$(call build_less,$(LESS_RTL_FILE),$(CSS_RTL_FILE))
2018-03-23 19:49:06 +00:00
demo: build
2018-05-28 00:38:01 +00:00
mkdir -p demo/themes/coder
rsync -av exampleSite/* demo
rsync -av --exclude='demo' --exclude='exampleSite' --exclude='.git' . demo/themes/coder
cd demo && hugo serve -D
2018-03-23 19:49:06 +00:00
clean:
rm -f $(CSS_DIR)/*.css
2018-05-28 00:38:01 +00:00
rm -rf demo