From owner-dev-commits-doc-all@freebsd.org Sun Feb 14 21:51:48 2021 Return-Path: Delivered-To: dev-commits-doc-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA56A53E717 for ; Sun, 14 Feb 2021 21:51:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Df1Cm4Pf1z4dRj; Sun, 14 Feb 2021 21:51:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AB5D12475; Sun, 14 Feb 2021 21:51:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11ELpmxw088464; Sun, 14 Feb 2021 21:51:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11ELpmcP088463; Sun, 14 Feb 2021 21:51:48 GMT (envelope-from git) Date: Sun, 14 Feb 2021 21:51:48 GMT Message-Id: <202102142151.11ELpmcP088463@gitrepo.freebsd.org> To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org From: Daniel Ebdrup Jensen Subject: git: 989bbd57fa - main - Makefiles: Add a conditional check on HOSTNAME variable MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: debdrup X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 989bbd57fa03b4efe7d920aeadeb0952c5960dda Auto-Submitted: auto-generated X-BeenThere: dev-commits-doc-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the doc repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2021 21:51:48 -0000 The branch main has been updated by debdrup: URL: https://cgit.FreeBSD.org/doc/commit/?id=989bbd57fa03b4efe7d920aeadeb0952c5960dda commit 989bbd57fa03b4efe7d920aeadeb0952c5960dda Author: Daniel Ebdrup Jensen AuthorDate: 2021-02-14 21:39:20 +0000 Commit: Daniel Ebdrup Jensen CommitDate: 2021-02-14 21:50:52 +0000 Makefiles: Add a conditional check on HOSTNAME variable In order for hugo to build all links correctly, it is necessary to define baseURL - but in order to do this, we need some way of adding a hostname. This change adds the HOSTNAME variable to accomplish this. Another advantage is that if HOSTNAME is set to something other than localhost, hugo can be run on a different (more powerful) machine which can shorten the time it takes to build. A note about this will need to be added to the FDP later. --- documentation/Makefile | 8 +++++++- website/Makefile | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/documentation/Makefile b/documentation/Makefile index 57472063dd..3b5c1cfd65 100644 --- a/documentation/Makefile +++ b/documentation/Makefile @@ -19,6 +19,12 @@ PYTHON_CMD = /usr/local/bin/python3.7 HUGO_CMD = /usr/local/bin/hugo LANGUAGES = en,es,pt-br,de,ja,zh-cn,zh-tw,ru,el,hu,it,mn,nl,pl,fr +.ifndef HOSTNAME +.HOST+=localhost +.else +.HOST+=$(HOSTNAME) +.endif + .ORDER: all run .ORDER: starting-message generate-books-toc @@ -41,7 +47,7 @@ generate-books-toc: .PHONY ${PYTHON_CMD} ./tools/books-toc-examples-creator.py -l ${LANGUAGES} run-local: .PHONY - ${HUGO_CMD} server -D + ${HUGO_CMD} server -D --baseURL="http://$(.HOST):1313" build: .PHONY ${HUGO_CMD} --minify diff --git a/website/Makefile b/website/Makefile index 6337692942..2294db8838 100644 --- a/website/Makefile +++ b/website/Makefile @@ -18,6 +18,12 @@ MAINTAINER=carlavilla@FreeBSD.org PYTHON_CMD = /usr/local/bin/python3.7 HUGO_CMD = /usr/local/bin/hugo +.ifndef HOSTNAME +.HOST+=localhost +.else +.HOST+=$(HOSTNAME) +.endif + .ORDER: all run .ORDER: starting-message generate-releases @@ -36,7 +42,7 @@ generate-releases: .PHONY ${PYTHON_CMD} ./tools/releases-toml.py -p ./shared/releases.adoc run-local: .PHONY - ${HUGO_CMD} server -D + ${HUGO_CMD} server -D --baseURL="http://$(.HOST):1313" build: .PHONY ${HUGO_CMD}