Improve demo command

This commit is contained in:
Luiz F. A. de Prá 2018-05-27 21:38:01 -03:00
parent ccf50e5893
commit c9d4c83faf
2 changed files with 7 additions and 14 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
**/themes/ **/themes/
demo/

View File

@ -3,9 +3,8 @@ LESS_FILE = style.less
CSS_DIR = ./static/css CSS_DIR = ./static/css
CSS_FILE = style.min.css CSS_FILE = style.min.css
CSS_TMP_FILE = tmp.css CSS_TMP_FILE = tmp.css
current_dir = $(shell pwd)
.PHONY: clean build .PHONY: clean demo build
build: clean build: clean
lessc $(LESS_DIR)/$(LESS_FILE) > $(CSS_DIR)/$(CSS_TMP_FILE) lessc $(LESS_DIR)/$(LESS_FILE) > $(CSS_DIR)/$(CSS_TMP_FILE)
@ -13,18 +12,11 @@ build: clean
rm -f $(CSS_DIR)/$(CSS_TMP_FILE) rm -f $(CSS_DIR)/$(CSS_TMP_FILE)
demo: build demo: build
mkdir -p exampleSite/themes/coder mkdir -p demo/themes/coder
mkdir -p exampleSite/themes/coder/archetypes rsync -av exampleSite/* demo
mkdir -p exampleSite/themes/coder/images rsync -av --exclude='demo' --exclude='exampleSite' --exclude='.git' . demo/themes/coder
mkdir -p exampleSite/themes/coder/layouts cd demo && hugo serve -D
mkdir -p exampleSite/themes/coder/static
cp -r $(current_dir)/archetypes/* exampleSite/themes/coder/archetypes/
cp -r $(current_dir)/images/* exampleSite/themes/coder/images
cp -r $(current_dir)/layouts/* exampleSite/themes/coder/layouts
cp -r $(current_dir)/static/* exampleSite/themes/coder/static
cp -r $(current_dir)/theme.toml exampleSite/themes/coder/theme.toml
cd exampleSite && hugo serve -D
clean: clean:
rm -f $(CSS_DIR)/*.css rm -f $(CSS_DIR)/*.css
rm -rf exampleSite/themes/coder rm -rf demo