new make file for better builds

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

@ -2,28 +2,36 @@


HUGO=hugo-extended HUGO=hugo-extended


.PHONY: build serve draft clean travis netlify

default all: build default all: build


build: .PHONY: build
$(HUGO) --minify 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 '*.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 '*.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" \; @find public/ -name '*.js' ! -name '*.gz' -type f -exec sh -c "gzip -c -9 < {} > {}.gz" \;


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

$(HUGO) --environment=development --minify
netlify:
$(HUGO) --minify --quiet --baseURL="$DEPLOY_PRIME_URL"


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


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

.PHONY: serve
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: clean:
@rm -rf public/ @rm -rf public/
@rm -rf resources/ @rm -rf resources/

Loading…
Cancel
Save