git: 284030c301 - main - Allow building the documentation and the website with upstream hugo

Sergio Carlavilla Delgado <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.doc
Message-ID <[email protected]>
The branch main has been updated by carlavilla:

URL: https://cgit.FreeBSD.org/doc/commit/?id=284030c301b967a9cbb51a83aff397cf00c80f1d

commit 284030c301b967a9cbb51a83aff397cf00c80f1d
Author:     Sergio Carlavilla Delgado <[email protected]>
AuthorDate: 2021-03-31 18:44:54 +0000
Commit:     Sergio Carlavilla Delgado <[email protected]>
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 <docroot>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 @@ [email protected]
 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 @@ [email protected]
 
 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"]
 
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-doc-all
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.