Upgrade Hugo to 0.52 (#11552)

* Update Hugo version and apply HTML minification to production builds

* Use full flag names for clarity

* Remove Hugo installation logic out of Travis config and into Makefile

* Add Hugo version checking script

* Fix Netlify config version
This commit is contained in:
Luc Perkins
2019-01-15 10:56:39 -08:00
committed by Kubernetes Prow Robot
parent 9c1248e467
commit aac7862a06
5 changed files with 37 additions and 14 deletions
+16 -6
View File
@@ -1,5 +1,5 @@
DOCKER = docker
HUGO_VERSION = 0.49
HUGO_VERSION = 0.52
DOCKER_IMAGE = kubernetes-hugo
DOCKER_RUN = $(DOCKER) run --rm --interactive --tty --volume $(CURDIR):/src
NODE_BIN = node_modules/.bin
@@ -13,10 +13,10 @@ help: ## Show this help.
all: build ## Build site with production settings and put deliverables in ./public
build: ## Build site with production settings and put deliverables in ./public
hugo
hugo --minify
build-preview: ## Build site with drafts and future posts enabled
hugo -D -F
hugo --buildDrafts --buildFuture
functions-build:
$(NETLIFY_FUNC) build functions-src
@@ -24,9 +24,9 @@ functions-build:
check-headers-file:
scripts/check-headers-file.sh
production-build: build check-headers-file ## Build the production site and ensure that noindex headers aren't added
production-build: check-hugo-versions build check-headers-file ## Build the production site and ensure that noindex headers aren't added
non-production-build: ## Build the non-production site, which adds noindex headers to prevent indexing
non-production-build: check-hugo-versions ## Build the non-production site, which adds noindex headers to prevent indexing
hugo --enableGitInfo
sass-build:
@@ -36,7 +36,7 @@ sass-develop:
scripts/sass.sh develop
serve: ## Boot the development server.
hugo server --ignoreCache --disableFastRender --buildFuture
hugo server --ignoreCache --buildFuture
docker-image:
$(DOCKER) build . --tag $(DOCKER_IMAGE) --build-arg HUGO_VERSION=$(HUGO_VERSION)
@@ -46,3 +46,13 @@ docker-build:
docker-serve:
$(DOCKER_RUN) -p 1313:1313 $(DOCKER_IMAGE) hugo server --buildFuture --bind 0.0.0.0
# This command is used only by Travis CI; do not run this locally
travis-hugo-build:
curl -L https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_linux-64bit.tar.gz | tar -xz
mkdir -p ${TRAVIS_HOME}/bin
mv hugo ${TRAVIS_HOME}/bin
export PATH=${TRAVIS_HOME}/bin:$PATH
check-hugo-versions:
scripts/hugo-version-check.sh $(HUGO_VERSION)