new make file for better builds

Signed-off-by: Toshaan Bharvani <toshaan@vantosh.com>
newmemberlevels
Toshaan Bharvani 3 years ago
parent 88cb5357b8
commit 90bd0177a3

@ -2,28 +2,36 @@

HUGO=hugo-extended

.PHONY: build serve draft clean travis netlify

default all: build

build:
$(HUGO) --minify
.PHONY: build
build: clean
$(HUGO) --environment=production --minify --templateMetrics
@find public/ -name '*.html' ! -name '*.gz' -type f -exec sh -c "gzip -c -9 < {} > {}.gz" \;
@find public/ -name '*.css' ! -name '*.gz' -type f -exec sh -c "gzip -c -9 < {} > {}.gz" \;
@find public/ -name '*.js' ! -name '*.gz' -type f -exec sh -c "gzip -c -9 < {} > {}.gz" \;

travis:
$(MAKE) HUGO=./hugo build

netlify:
$(HUGO) --minify --quiet --baseURL="$DEPLOY_PRIME_URL"
.PHONY: test
test: clean
$(HUGO) --environment=development --minify

.PHONY: draft
draft:
$(HUGO) --minify --buildDrafts --buildFuture --buildExpired
$(HUGO) --environment=development --minify --buildDrafts --buildFuture --buildExpired

.PHONY: debug
debug:
$(HUGO) --debug

.PHONY: serve
serve:
$(HUGO) server --disableFastRender --watch
$(HUGO) server --environment=development --noHTTPCache --disableFastRender --watch

.PHONY: servedraft
servedraft:
$(HUGO) server --environment=development --buildFuture --buildExpired --noHTTPCache --disableFastRender --watch

.PHONY: clean
clean:
@rm -rf public/
@rm -rf resources/

Loading…
Cancel
Save