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/
demo/

View File

@ -3,9 +3,8 @@ LESS_FILE = style.less
CSS_DIR = ./static/css
CSS_FILE = style.min.css
CSS_TMP_FILE = tmp.css
current_dir = $(shell pwd)
.PHONY: clean build
.PHONY: clean demo build
build: clean
lessc $(LESS_DIR)/$(LESS_FILE) > $(CSS_DIR)/$(CSS_TMP_FILE)
@ -13,18 +12,11 @@ build: clean
rm -f $(CSS_DIR)/$(CSS_TMP_FILE)
demo: build
mkdir -p exampleSite/themes/coder
mkdir -p exampleSite/themes/coder/archetypes
mkdir -p exampleSite/themes/coder/images
mkdir -p exampleSite/themes/coder/layouts
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
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
clean:
rm -f $(CSS_DIR)/*.css
rm -rf exampleSite/themes/coder
rm -rf demo