From 90bd0177a384c8fa72ee8a01d169fc3a4ff90b80 Mon Sep 17 00:00:00 2001 From: Toshaan Bharvani Date: Thu, 19 Aug 2021 21:55:28 +0200 Subject: [PATCH] new make file for better builds Signed-off-by: Toshaan Bharvani --- Makefile | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 4939fcc..84fc1fa 100644 --- a/Makefile +++ b/Makefile @@ -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/