2018-06-21 17:13:29 +00:00
|
|
|
DOCKER = docker
|
2019-12-04 07:06:57 +00:00
|
|
|
HUGO_VERSION = 0.59.1
|
2018-06-21 17:13:29 +00:00
|
|
|
DOCKER_IMAGE = kubernetes-hugo
|
2018-11-14 01:43:59 +00:00
|
|
|
DOCKER_RUN = $(DOCKER) run --rm --interactive --tty --volume $(CURDIR):/src
|
2018-10-03 20:04:39 +00:00
|
|
|
NODE_BIN = node_modules/.bin
|
|
|
|
NETLIFY_FUNC = $(NODE_BIN)/netlify-lambda
|
2018-06-21 17:13:29 +00:00
|
|
|
|
2019-06-09 13:31:07 +00:00
|
|
|
.PHONY: all build build-preview help serve
|
2016-09-07 23:37:43 +00:00
|
|
|
|
|
|
|
help: ## Show this help.
|
|
|
|
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
|
|
|
|
|
2018-08-21 19:51:15 +00:00
|
|
|
all: build ## Build site with production settings and put deliverables in ./public
|
2016-09-07 23:37:43 +00:00
|
|
|
|
2018-08-21 19:51:15 +00:00
|
|
|
build: ## Build site with production settings and put deliverables in ./public
|
2019-01-15 18:56:39 +00:00
|
|
|
hugo --minify
|
2016-09-07 23:37:43 +00:00
|
|
|
|
2018-08-21 19:51:15 +00:00
|
|
|
build-preview: ## Build site with drafts and future posts enabled
|
2019-01-15 18:56:39 +00:00
|
|
|
hugo --buildDrafts --buildFuture
|
2016-09-07 23:37:43 +00:00
|
|
|
|
2018-10-03 20:04:39 +00:00
|
|
|
functions-build:
|
|
|
|
$(NETLIFY_FUNC) build functions-src
|
|
|
|
|
2018-08-21 19:51:15 +00:00
|
|
|
check-headers-file:
|
|
|
|
scripts/check-headers-file.sh
|
|
|
|
|
2019-05-09 17:08:51 +00:00
|
|
|
production-build: check-hugo-versions build check-headers-file ## Build the production site and ensure that noindex headers aren't added
|
2018-08-21 19:51:15 +00:00
|
|
|
|
2019-06-26 22:21:20 +00:00
|
|
|
non-production-build: check-hugo-versions ## Build the non-production site, which adds noindex headers to prevent indexing
|
2018-08-21 19:51:15 +00:00
|
|
|
hugo --enableGitInfo
|
|
|
|
|
2016-09-07 23:37:43 +00:00
|
|
|
serve: ## Boot the development server.
|
2019-03-14 13:52:26 +00:00
|
|
|
hugo server --buildFuture
|
2017-08-06 04:11:12 +00:00
|
|
|
|
2018-06-21 17:13:29 +00:00
|
|
|
docker-image:
|
|
|
|
$(DOCKER) build . --tag $(DOCKER_IMAGE) --build-arg HUGO_VERSION=$(HUGO_VERSION)
|
|
|
|
|
|
|
|
docker-build:
|
|
|
|
$(DOCKER_RUN) $(DOCKER_IMAGE) hugo
|
|
|
|
|
2018-07-27 17:33:57 +00:00
|
|
|
docker-serve:
|
2018-12-04 16:44:17 +00:00
|
|
|
$(DOCKER_RUN) -p 1313:1313 $(DOCKER_IMAGE) hugo server --buildFuture --bind 0.0.0.0
|
2019-01-15 18:56:39 +00:00
|
|
|
|
2019-04-11 08:40:13 +00:00
|
|
|
test-examples:
|
|
|
|
scripts/test_examples.sh install
|
|
|
|
scripts/test_examples.sh run
|
2019-01-15 18:56:39 +00:00
|
|
|
|
|
|
|
check-hugo-versions:
|
|
|
|
scripts/hugo-version-check.sh $(HUGO_VERSION)
|