Page MenuHomeFreeBSD

D30796.diff
No OneTemporary

D30796.diff

diff --git a/documentation/Makefile b/documentation/Makefile
--- a/documentation/Makefile
+++ b/documentation/Makefile
@@ -20,6 +20,9 @@
# List of languages without book translations
ARTICLEONLY_LANGS= bd da ko tr
+# List of all languages we have content for
+ALL_LANGUAGES= bd da de el en es fr hu it ja ko mn nl pl pt-br ru tr zh-cn zh-tw
+
LOCALBASE?= /usr/local
PYTHON_CMD = ${LOCALBASE}/bin/python3
@@ -27,10 +30,15 @@
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:S/,/ /g}
+.if ${LANGUAGES:Men} == ""
+.warning "Warning: cannot skip 'en'; adding it back"
+LANGUAGES+= en
+.endif
.else
-LANGUAGES= bd da de el en es fr hu it ja ko mn nl pl pt-br ru tr zh-cn zh-tw
+LANGUAGES= ${ALL_LANGUAGES}
.endif
RUBYLIB = ../shared/lib
@@ -59,6 +67,16 @@
BOOK_LANGS:= ${BOOK_LANGS:N${a}}
.endfor
+
+# Take the list of all languages, and take out the ones we have been
+# asked for. We'll feed this to hugo.
+SKIP_LANGS=
+.for a in ${ALL_LANGUAGES}
+.if ${LANGUAGES:M${a}} == ""
+SKIP_LANGS+= ${a}
+.endif
+.endfor
+
.ORDER: all run
.ORDER: requirements
@@ -82,6 +100,8 @@
starting-message: .PHONY
@echo ---------------------------------------------------------------
@echo Building the documentation
+ @echo included languages: ${LANGUAGES}
+ @echo excluded languages: ${SKIP_LANGS}
@echo ---------------------------------------------------------------
generate-books-toc: .PHONY
@@ -97,10 +117,11 @@
${RUBY_CMD} ./tools/global-pgpkeys-creator.rb
run-local: .PHONY
- ${HUGO_CMD} server ${HUGO_ARGS} -D $(BIND:D--bind=$(BIND)) --baseURL="http://$(.HOST):1313"
+ HUGO_DISABLELANGUAGES="${SKIP_LANGS}" ${HUGO_CMD} server \
+ ${HUGO_ARGS} -D $(BIND:D--bind=$(BIND)) --baseURL="http://$(.HOST):1313"
build: .PHONY
- ${HUGO_CMD} ${HUGO_ARGS}
+ HUGO_DISABLELANGUAGES="${SKIP_LANGS}" ${HUGO_CMD} ${HUGO_ARGS}
toc-clean: .PHONY
rm -f $$(${PYTHON_CMD} ./tools/books-toc-parts-creator.py -l ${BOOK_LANGS} -o)
diff --git a/website/Makefile b/website/Makefile
--- a/website/Makefile
+++ b/website/Makefile
@@ -15,6 +15,9 @@
MAINTAINER=carlavilla@FreeBSD.org
+# List of all languages we have content for
+ALL_LANGUAGES= de el en es fr hu it ja nl ru tr zh-cn zh-tw
+
PYTHON_CMD = /usr/local/bin/python3
HUGO_CMD = /usr/local/bin/hugo
HUGO_ARGS?= --verbose
@@ -31,6 +34,25 @@
.HOST=$(HOSTNAME)
.endif
+.if defined(DOC_LANG) && !empty(DOC_LANG)
+LANGUAGES= ${DOC_LANG:S/,/ /g}
+.if ${LANGUAGES:Men} == ""
+.warning "Warning: cannot skip 'en'; adding it back"
+LANGUAGES+= en
+.endif
+.else
+LANGUAGES= ${ALL_LANGUAGES}
+.endif
+
+# Take the list of all languages, and take out the ones we have been
+# asked for via DOC_LANG. We'll feed this to hugo.
+SKIP_LANGS=
+.for a in ${ALL_LANGUAGES}
+.if ${LANGUAGES:M${a}} == ""
+SKIP_LANGS+= ${a}
+.endif
+.endfor
+
.ORDER: all run
.ORDER: starting-message generate-releases
@@ -46,6 +68,8 @@
starting-message: .PHONY
@echo "---------------------------------------------------------------"
@echo "Building the website started on $$(date)"
+ @echo " included languages: ${LANGUAGES}"
+ @echo " excluded languages: ${SKIP_LANGS}"
@echo "---------------------------------------------------------------"
end-message: .PHONY
@@ -59,10 +83,11 @@
${PYTHON_CMD} ./tools/releases-toml.py -p ./shared/releases.adoc
run-local: .PHONY
- ${HUGO_CMD} server ${HUGO_ARGS} -D $(BIND:D--bind=$(BIND)) --baseURL="http://$(.HOST):1313"
+ HUGO_DISABLELANGUAGES="${SKIP_LANGS}" ${HUGO_CMD} server \
+ ${HUGO_ARGS} -D $(BIND:D--bind=$(BIND)) --baseURL="http://$(.HOST):1313"
build: .PHONY
- ${HUGO_CMD} ${HUGO_ARGS}
+ HUGO_DISABLELANGUAGES="${SKIP_LANGS}" ${HUGO_CMD} ${HUGO_ARGS}
post-build: cgi-permissions

File Metadata

Mime Type
text/plain
Expires
Wed, Aug 5, 2:04 AM (3 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35981388
Default Alt Text
D30796.diff (3 KB)

Event Timeline