Improve demo command
This commit is contained in:
parent
ccf50e5893
commit
c9d4c83faf
|
@ -1 +1,2 @@
|
|||
**/themes/
|
||||
demo/
|
||||
|
|
20
Makefile
20
Makefile
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue