From f970a659bae62b823ea82b837a578be65b0fa16f Mon Sep 17 00:00:00 2001 From: Patrick Neff Date: Thu, 17 Jan 2019 18:51:01 +0100 Subject: [PATCH] add local target to makefile --- Makefile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 65d2391..0b043e5 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,6 @@ THEME = neff +LOCAL_DIR = /srv/http/staging +REMOTE_DIR = /srv/http/live REMOTE = dev.test:/var/www/neff-steindesign.dev.test HUGO = /usr/bin/hugo @@ -7,11 +9,15 @@ RSYNC = /usr/bin/rsync JPEGOPTIM = /usr/bin/jpegoptim OPTIPNG = /usr/bin/optipng -.PHONY: all clean server jpegoptim optipng site staging theme +.PHONY: all clean server jpegoptim optipng site staging theme local .SUFFIXES: .jpg .png .md .html .js .css .scss .toml DIRS = content data static themes/$(THEME) resources +HUGO_ARGS = --gc --minify + +IP := $(shell hostname --ip-address) + all: $(DIRS) public/* clean: @@ -22,7 +28,10 @@ theme: $(NPM) --prefix="themes/$(THEME)" run build site: - $(HUGO) --gc + $(HUGO) $(HUGO_ARGS) --destination $(REMOTE_DIR) + +local: + $(HUGO) $(HUGO_ARGS) --baseURL http://$(IP) --destination $(LOCAL_DIR) staging: $(HUGO) --buildDrafts --buildExpired --buildFuture --gc