git: 163f29fb33 - main - Add support to Hugo arguments/flags

Danilo G. Baio dbaio at FreeBSD.org
Sat Jun 5 17:31:16 UTC 2021


The branch main has been updated by dbaio:

URL: https://cgit.FreeBSD.org/doc/commit/?id=163f29fb33bf5cd8101635f5c7cddfcc04a0d28d

commit 163f29fb33bf5cd8101635f5c7cddfcc04a0d28d
Author:     Danilo G. Baio <dbaio at FreeBSD.org>
AuthorDate: 2021-06-05 17:25:34 +0000
Commit:     Danilo G. Baio <dbaio at FreeBSD.org>
CommitDate: 2021-06-05 17:25:34 +0000

    Add support to Hugo arguments/flags
    
    This also enables verbose output by default, same behavior we had in the
    doc tree before Hugo/Asciidoctor and add --minify to HUGO_ARGS variable
    to make it optional.
    
    Reviewed by:    ceri, allanjude, imp
    Differential Revision:  https://reviews.freebsd.org/D30652
---
 documentation/Makefile | 5 +++--
 website/Makefile       | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/documentation/Makefile b/documentation/Makefile
index a10461f4ae..606d79c30f 100644
--- a/documentation/Makefile
+++ b/documentation/Makefile
@@ -21,6 +21,7 @@ LOCALBASE?=	/usr/local
 PYTHON_CMD =	${LOCALBASE}/bin/python3
 RUBY_CMD =	${LOCALBASE}/bin/ruby
 HUGO_CMD =	${LOCALBASE}/bin/hugo
+HUGO_ARGS?=	--verbose --minify
 ASCIIDOCTORPDF_CMD=	${LOCALBASE}/bin/asciidoctor-pdf
 .if defined(DOC_LANG) && !empty(DOC_LANG)
 LANGUAGES =	${DOC_LANG}
@@ -78,10 +79,10 @@ static/pgpkeys/pgpkeys.txt: static/pgpkeys/*key
 	${RUBY_CMD} ./tools/global-pgpkeys-creator.rb
 
 run-local: .PHONY
-	${HUGO_CMD} server -D $(BIND:D--bind=$(BIND)) --baseURL="http://$(.HOST):1313"
+	${HUGO_CMD} server ${HUGO_ARGS} -D $(BIND:D--bind=$(BIND)) --baseURL="http://$(.HOST):1313"
 
 build: .PHONY
-	${HUGO_CMD} --minify
+	${HUGO_CMD} ${HUGO_ARGS}
 
 #
 # PDF targets
diff --git a/website/Makefile b/website/Makefile
index 560c7b8d45..fbee771541 100644
--- a/website/Makefile
+++ b/website/Makefile
@@ -17,6 +17,7 @@ MAINTAINER=carlavilla at FreeBSD.org
 
 PYTHON_CMD =	/usr/local/bin/python3
 HUGO_CMD =	/usr/local/bin/hugo
+HUGO_ARGS?=	--verbose
 RUBYLIB =	../shared/lib
 .export	RUBYLIB
 
@@ -51,10 +52,10 @@ generate-releases: .PHONY
 	${PYTHON_CMD} ./tools/releases-toml.py -p ./shared/releases.adoc
 
 run-local: .PHONY
-	${HUGO_CMD} server -D $(BIND:D--bind=$(BIND)) --baseURL="http://$(.HOST):1313"
+	${HUGO_CMD} server ${HUGO_ARGS} -D $(BIND:D--bind=$(BIND)) --baseURL="http://$(.HOST):1313"
 
 build: .PHONY
-	${HUGO_CMD}
+	${HUGO_CMD} ${HUGO_ARGS}
 
 post-build: cgi-permissions
 


More information about the dev-commits-doc-all mailing list