git: 28b246c825 - main - Teach hugo to listen over TLS without a port appended
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 20 Jun 2026 03:28:54 UTC
The branch main has been updated by dch:
URL: https://cgit.FreeBSD.org/doc/commit/?id=28b246c8258ce8497f0aa1b1f5d4e093aeb4ce04
commit 28b246c8258ce8497f0aa1b1f5d4e093aeb4ce04
Author: Dave Cottlehuber <dch@FreeBSD.org>
AuthorDate: 2026-06-20 03:23:45 +0000
Commit: Dave Cottlehuber <dch@FreeBSD.org>
CommitDate: 2026-06-20 03:27:48 +0000
Teach hugo to listen over TLS without a port appended
Add targets to documentation & website, to serve the website over TLS,
with nice clean URLs. You will need to provide the TLS terminating proxy
yourself.
Differential Revision: https://reviews.freebsd.org/D53930
Approved by: ziaee
Reviewed by: kevans
Event: BSDCan 2026
Sponsored by: SkunkWerks, GmbH
---
documentation/Makefile | 8 ++++++++
website/Makefile | 6 ++++++
2 files changed, 14 insertions(+)
diff --git a/documentation/Makefile b/documentation/Makefile
index df6587f487..b4b7bfa6e3 100644
--- a/documentation/Makefile
+++ b/documentation/Makefile
@@ -9,6 +9,9 @@
# PDFs or EPUBs.
# clean - Remove generated files.
# run - Serve the built documentation site locally.
+# run-tls - Serve the built documentation site over TLS.
+# Note this requires a TLS terminating proxy.
+#
# pdf - Build PDF versions of the articles and books.
# html - Build HTML versions of the articles and books.
# If the DOC_HTML_ARCHIVE variable is set, all
@@ -111,6 +114,7 @@ SKIP_LANGS+= ${a}
all: requirements starting-message generate-pgpkeys-txt build
run: requirements starting-message generate-pgpkeys-txt run-local
+run-tls: requirements starting-message generate-pgpkeys-txt run-tls-local
# clean does not call pdf-clean as that is a subset of hugo-clean
clean: hugo-clean pgp-clean
@@ -148,6 +152,10 @@ run-local: .PHONY
HUGO_DISABLELANGUAGES="${SKIP_LANGS}" ${HUGO_CMD} server \
${HUGO_ARGS} -D $(BIND:D--bind=$(BIND)) --baseURL="http://$(.HOST):1313"
+run-tls-local: .PHONY
+ HUGO_DISABLELANGUAGES="${SKIP_LANGS}" ${HUGO_CMD} server \
+ ${HUGO_ARGS} -D $(BIND:D--bind=$(BIND)) --baseURL="https://$(.HOST)"
+
build: .PHONY
HUGO_DISABLELANGUAGES="${SKIP_LANGS}" ${HUGO_CMD} ${HUGO_ARGS}
diff --git a/website/Makefile b/website/Makefile
index 25b69804e1..3f096c47c0 100644
--- a/website/Makefile
+++ b/website/Makefile
@@ -7,6 +7,8 @@
#
# all (default) - Generate releases.toml and compile the website.
# run - Serve the built website for local browsing.
+# run-tls - Serve the built documentation site over TLS.
+# Note this requires a TLS terminating proxy.
#
# The run target uses hugo's built-in webserver to make the built
# website available for local browsing. The website should have been
@@ -65,6 +67,7 @@ SKIP_LANGS+= ${a}
all: starting-message generate-releases cgi-pre-permissions build post-build end-message
run: starting-message generate-releases cgi-pre-permissions run-local
+run-tls: starting-message generate-releases cgi-pre-permissions run-tls-local
clean: hugo-clean releases-clean
starting-message: .PHONY
@@ -87,6 +90,9 @@ data/releases.toml:
run-local: .PHONY
HUGO_DISABLELANGUAGES="${SKIP_LANGS}" ${HUGO_CMD} server \
${HUGO_ARGS} -D $(BIND:D--bind=$(BIND)) --baseURL="http://$(.HOST):1313"
+run-tls-local: .PHONY
+ HUGO_DISABLELANGUAGES="${SKIP_LANGS}" ${HUGO_CMD} server \
+ ${HUGO_ARGS} -D $(BIND:D--bind=$(BIND)) --baseURL="https://$(.HOST)"
build: .PHONY
HUGO_DISABLELANGUAGES="${SKIP_LANGS}" ${HUGO_CMD} ${HUGO_ARGS}