add local target to makefile

This commit is contained in:
Patrick Neff 2019-01-17 18:51:01 +01:00
parent 6bfa13b5e9
commit f970a659ba
1 changed files with 11 additions and 2 deletions

View File

@ -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