From owner-dev-commits-doc-all@freebsd.org Wed Mar 31 18:47:27 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 1E1245AC39C for ; Wed, 31 Mar 2021 18:47:27 +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 4F9b0H0N6Rz4TwL; Wed, 31 Mar 2021 18:47:27 +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 F3FCC1E90C; Wed, 31 Mar 2021 18:47:26 +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 12VIlQpc021424; Wed, 31 Mar 2021 18:47:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12VIlQHk021423; Wed, 31 Mar 2021 18:47:26 GMT (envelope-from git) Date: Wed, 31 Mar 2021 18:47:26 GMT Message-Id: <202103311847.12VIlQHk021423@gitrepo.freebsd.org> To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org From: Sergio Carlavilla Delgado Subject: git: 284030c301 - main - Allow building the documentation and the website with upstream hugo MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: carlavilla X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 284030c301b967a9cbb51a83aff397cf00c80f1d 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: Wed, 31 Mar 2021 18:47:27 -0000 The branch main has been updated by carlavilla: URL: https://cgit.FreeBSD.org/doc/commit/?id=284030c301b967a9cbb51a83aff397cf00c80f1d commit 284030c301b967a9cbb51a83aff397cf00c80f1d Author: Sergio Carlavilla Delgado AuthorDate: 2021-03-31 18:44:54 +0000 Commit: Sergio Carlavilla Delgado CommitDate: 2021-03-31 18:44:54 +0000 Allow building the documentation and the website with upstream hugo When we build our documentation and website we use a hacked version of www/gohugo that allows for arbitrary asciidoc extensions. This was added as a patch in r562416. The suggested pull request[1] this patch was based on was not accepted "as is" and only allows the execution of extensions in Ruby's $LOAD_PATH. With these changes, we add our shared/lib directory to Ruby's library directory so we can load our custom extensions. This also allows building the docs and website outsite FreeBSD using upstream and unmodified tools. Tested with the upcoming vanilla gohugo-0.82 provided by gohugo's maintainer. [1] https://github.com/gohugoio/hugo/pull/8131 Patch by: fernape@ Differential Revision: https://reviews.freebsd.org/D29410 --- documentation/Makefile | 2 ++ documentation/config/_default/config.toml | 2 +- website/Makefile | 2 ++ website/config/_default/config.toml | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/documentation/Makefile b/documentation/Makefile index 4b594fcdca..72f5b89dda 100644 --- a/documentation/Makefile +++ b/documentation/Makefile @@ -18,6 +18,8 @@ MAINTAINER=carlavilla@FreeBSD.org PYTHON_CMD = /usr/local/bin/python3 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 +RUBYLIB = ../shared/lib +.export RUBYLIB .ifndef HOSTNAME .HOST+=localhost diff --git a/documentation/config/_default/config.toml b/documentation/config/_default/config.toml index 316f8bacd8..fd4b3983fc 100644 --- a/documentation/config/_default/config.toml +++ b/documentation/config/_default/config.toml @@ -19,7 +19,7 @@ enableRobotsTXT = true [markup.asciidocExt] preserveTOC = true - extensions = ["../shared/lib/man-macro.rb", "../shared/lib/inter-document-references-macro.rb", "../shared/lib/sectnumoffset-treeprocessor.rb", "../shared/lib/packages-macro.rb", "../shared/lib/git-macro.rb"] + extensions = ["man-macro", "inter-document-references-macro", "sectnumoffset-treeprocessor", "packages-macro", "git-macro"] [outputs] home = [ "HTML" ] diff --git a/website/Makefile b/website/Makefile index 4b32bf76d7..a4b6bf497a 100644 --- a/website/Makefile +++ b/website/Makefile @@ -17,6 +17,8 @@ MAINTAINER=carlavilla@FreeBSD.org PYTHON_CMD = /usr/local/bin/python3 HUGO_CMD = /usr/local/bin/hugo +RUBYLIB = ../shared/lib +.export RUBYLIB .ifndef HOSTNAME .HOST+=localhost diff --git a/website/config/_default/config.toml b/website/config/_default/config.toml index a7c4585ebe..cc754900b3 100644 --- a/website/config/_default/config.toml +++ b/website/config/_default/config.toml @@ -17,7 +17,7 @@ preserveTOC = true [markup.asciidocExt] preserveTOC = true - extensions = ["../shared/lib/man-macro.rb", "../shared/lib/inter-document-references-macro.rb", "../shared/lib/sectnumoffset-treeprocessor.rb", "../shared/lib/packages-macro.rb", "../shared/lib/git-macro.rb"] + extensions = ["man-macro", "inter-document-references-macro", "sectnumoffset-treeprocessor", "packages-macro", "git-macro"] staticDir = ["static", "shared"]