You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by rc...@apache.org on 2023/03/28 02:03:06 UTC

[james-site] 21/30: Uses antora supplemental_files to customize UI

This is an automated email from the ASF dual-hosted git repository.

rcordier pushed a commit to branch staging
in repository https://gitbox.apache.org/repos/asf/james-site.git

commit 7d5b1c9101fc4c3bed9eb408185cf43cac983fda
Author: Jean Helou <jh...@codamens.fr>
AuthorDate: Sat Apr 3 10:49:49 2021 +0200

    Uses antora supplemental_files to customize UI
    
    Antora supplemental_files are not well documented but they allow to
    override the UI templates from the UI bundle, not that this mecanisme
    DOES NOT allow properly overriding UI style, only content and HTML
    structure.
---
 .gitignore                                         |  6 ++-
 doc-sites/antora-playbook-local.yml                | 34 ++++----------
 doc-sites/antora-playbook.yml                      | 49 ++++++--------------
 doc-sites/ui-overrides/img/james.svg               | 36 +++++++++++++++
 doc-sites/ui-overrides/partials/header-content.hbs | 52 ++++++++++++++++++++++
 5 files changed, 114 insertions(+), 63 deletions(-)

diff --git a/.gitignore b/.gitignore
index c81bc51dd..1d5f4c11d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,8 +4,12 @@
 # Ignore Gradle build output directory
 build
 
+
+# Ignore antora cache directorry
+doc-sites/.cache
+
 .vscode
 .project
 
 node_modules
-target
\ No newline at end of file
+target
diff --git a/doc-sites/antora-playbook-local.yml b/doc-sites/antora-playbook-local.yml
index 719c08975..96e332b5d 100644
--- a/doc-sites/antora-playbook-local.yml
+++ b/doc-sites/antora-playbook-local.yml
@@ -8,33 +8,15 @@ site:
   start_page: james-site::homepage.adoc
 content:
   sources:
-  - url: ./../../james-hupa
-    branches: HEAD
-    start_path: docs
-  - url: ./../../james-jdkim
-    branches: HEAD
-    start_path: docs
-  - url: ./../../james-jsieve
-    branches: HEAD
-    start_path: docs
-  - url: ./../../james-jspf
-    branches: HEAD
-    start_path: docs
-  - url: ./../../james-mime4j
-    branches: HEAD
-    start_path: docs
-  - url: ./../../james-project
-    branches: HEAD
-    start_path: docs
-  - url: ./../../james-postage
-    branches: HEAD
-    start_path: docs
-  - url: ./../
-    branches: HEAD
-    start_path: docs
+    - url: ./../../james-project
+      branches: HEAD
+      start_path: docs
+    - url: ./../
+      branches: HEAD
+      start_path: docs
 ui:
   bundle:
-    url: ./../antora-ui/build/ui-bundle.zip
-    # start_path: ui-bundle
+    url: https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/master/raw/build/ui-bundle.zip?job=bundle-stable
+  supplemental_files: ./ui-overrides
 runtime:
   fetch: true
diff --git a/doc-sites/antora-playbook.yml b/doc-sites/antora-playbook.yml
index 75a6900b9..ea115e84b 100644
--- a/doc-sites/antora-playbook.yml
+++ b/doc-sites/antora-playbook.yml
@@ -1,44 +1,21 @@
+runtime:
+  cache_dir: ./.cache/antora
+  fetch: true
 site:
   title: Apache James
   url: https://james.apache.org/
   start_page: james-site::homepage.adoc
 content:
   sources:
-  - url: https://github.com/apache/james-hupa.git
-    branches: master
-    start_path: docs
-    edit_url: '{web_url}/blob/{refname}/{path}'
-  - url: https://github.com/apache/james-jdkim.git
-    branches: master
-    start_path: docs
-    edit_url: '{web_url}/blob/{refname}/{path}'
-  - url: https://github.com/apache/james-jsieve.git
-    branches: master
-    start_path: docs
-    edit_url: '{web_url}/blob/{refname}/{path}'
-  - url: https://github.com/apache/james-jspf.git
-    branches: master
-    start_path: docs
-    edit_url: '{web_url}/blob/{refname}/{path}'
-  - url: https://github.com/apache/james-mime4j.git
-    branches: master
-    start_path: docs
-    edit_url: '{web_url}/blob/{refname}/{path}'
-  - url: https://github.com/apache/james-project.git
-    branches: master
-    start_path: docs
-    edit_url: '{web_url}/blob/{refname}/{path}'
-  - url: https://github.com/apache/james-postage.git
-    branches: master
-    start_path: docs
-    edit_url: '{web_url}/blob/{refname}/{path}'
-  - url: ./../
-    branches: HEAD
-    start_path: docs
-    edit_url: '{web_url}/blob/{refname}/{path}'
+    - url: https://github.com/apache/james-project.git
+      branches: master
+      start_path: docs
+      edit_url: "{web_url}/blob/{refname}/{path}"
+    - url: ./../
+      branches: HEAD
+      start_path: docs
+      edit_url: "{web_url}/blob/{refname}/{path}"
 ui:
   bundle:
-    url: ./../antora-ui/build/ui-bundle.zip
-    # start_path: ui-bundle
-runtime:
-  fetch: true
+    url: https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/master/raw/build/ui-bundle.zip?job=bundle-stable
+  supplemental_files: ./ui-overrides
diff --git a/doc-sites/ui-overrides/img/james.svg b/doc-sites/ui-overrides/img/james.svg
new file mode 100644
index 000000000..cdab29b7f
--- /dev/null
+++ b/doc-sites/ui-overrides/img/james.svg
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 15.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Calque_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 width="37px" height="31px" viewBox="0 0 37 31" enable-background="new 0 0 37 31" xml:space="preserve">
+<g>
+	<path fill="#FFFFFF" d="M37.001,4.407c-1.435-0.966-2.92-1.75-4.473-2.153c-1.552-0.412-3.151-0.315-4.63,0.3l-0.277,0.117
+		l-0.139,0.062l-0.064,0.032l-0.036,0.016l-0.018,0.008l-0.008,0.004c0.008-0.007-0.028,0.016,0.02-0.012L27.37,2.783
+		c-0.2,0.127-0.391,0.232-0.589,0.337c-0.392,0.207-0.796,0.391-1.216,0.543c-0.836,0.295-1.737,0.503-2.664,0.389
+		c-0.458-0.061-0.913-0.222-1.3-0.489c-0.382-0.268-0.689-0.629-0.899-1.026C20.28,1.737,20.15,0.857,20.124,0
+		c0.156,0.842,0.393,1.686,0.857,2.363c0.234,0.336,0.523,0.622,0.864,0.811c0.339,0.19,0.723,0.284,1.111,0.301
+		c0.782,0.038,1.582-0.201,2.325-0.532c0.376-0.165,0.741-0.353,1.092-0.563c0.176-0.105,0.354-0.219,0.509-0.33l0.307-0.201
+		c0.1-0.057,0.194-0.122,0.293-0.173c0.801-0.433,1.702-0.731,2.627-0.793c0.925-0.069,1.856,0.063,2.716,0.357
+		c0.863,0.29,1.655,0.731,2.359,1.267C35.888,3.047,36.52,3.676,37.001,4.407z"/>
+	<path fill="#FFFFFF" d="M13.25,20.418c-5.733-4.373-9.554-8.973-9.418-9.078c0.147-0.145,4.153,4.212,9.83,8.536
+		c1.665,1.28,3.28,2.412,4.733,3.381c0.02-0.036,0.041-0.069,0.062-0.105c0.237-0.456,0.42-0.948,0.562-1.462
+		c-1.018-2.053-3.554-4.892-6.501-7.496c-0.656-0.572-1.338-1.078-2.028-1.536c-0.151,1.223-0.452,2.098-0.453,2.096
+		c0,0-0.335-1.163-0.306-2.579C9.266,11.892,8.8,11.63,8.336,11.389c-0.004,1.395-0.414,2.439-0.417,2.439
+		c0,0.002-0.833-1.414-0.922-3.071c-0.002-0.01-0.002-0.021-0.002-0.031c-2.767-1.279-5.1-1.896-5.104-1.89
+		C1.867,8.774,2.064,14.75,6.431,19.305c0.147-0.008,0.296-0.016,0.449-0.016c1.588,0.004,2.944,0.577,2.947,0.577
+		c0-0.002-0.835,0.501-2.054,0.671c0.444,0.355,0.899,0.682,1.364,0.973c1.148-0.416,2.102-0.557,2.102-0.557
+		c0-0.002-0.503,0.495-1.334,1.017c3.035,1.685,5.787,2.542,7.53,2.624c0.236-0.26,0.452-0.532,0.645-0.821
+		C16.586,22.84,14.938,21.717,13.25,20.418z"/>
+	<path fill="#FFFFFF" d="M33.7,4.335c-1.103,0.092-2.21,0.292-3.3,0.605c-2.173,0.623-4.31,1.725-6.062,3.396
+		c-0.883,0.824-1.64,1.798-2.271,2.846c-0.614,1.059-1.109,2.191-1.43,3.363c-0.327,1.168-0.529,2.363-0.595,3.548
+		c-0.02,0.291-0.031,0.596-0.039,0.9L19.995,19.4l-0.008,0.35c-0.012,0.462-0.051,0.918-0.122,1.358
+		c-0.056,0.337-0.131,0.665-0.223,0.984c-0.141,0.514-0.324,1.006-0.562,1.466c-0.02,0.036-0.043,0.066-0.062,0.102
+		c-0.099,0.178-0.204,0.353-0.317,0.52c-0.191,0.286-0.407,0.559-0.643,0.819c-0.17,0.186-0.348,0.366-0.544,0.541
+		c-1.304,1.152-3.097,1.944-5.021,2.453c-1.931,0.518-3.995,0.788-6.091,0.934c-2.1,0.145-4.234,0.166-6.404,0.112
+		c2.023,0.815,4.157,1.338,6.333,1.664c2.179,0.313,4.422,0.415,6.701,0.127c1.137-0.149,2.287-0.394,3.418-0.802
+		c1.129-0.405,2.252-0.959,3.265-1.745c1.019-0.771,1.92-1.77,2.571-2.913c0.331-0.568,0.601-1.167,0.82-1.775
+		c0.21-0.611,0.364-1.236,0.47-1.859c0.11-0.619,0.17-1.24,0.193-1.852c0.008-0.154,0.008-0.307,0.008-0.461v-0.398
+		c0.005-0.234,0.011-0.468,0.022-0.716c0.052-0.967,0.166-1.914,0.376-2.832c0.418-1.832,1.213-3.537,2.405-5.009
+		c1.192-1.472,2.767-2.711,4.552-3.706c1.79-0.994,3.765-1.774,5.862-2.355C35.917,4.247,34.808,4.238,33.7,4.335z"/>
+</g>
+</svg>
diff --git a/doc-sites/ui-overrides/partials/header-content.hbs b/doc-sites/ui-overrides/partials/header-content.hbs
new file mode 100644
index 000000000..caa1c0baa
--- /dev/null
+++ b/doc-sites/ui-overrides/partials/header-content.hbs
@@ -0,0 +1,52 @@
+<header class="header">
+  <nav class="navbar">
+    <div class="navbar-brand">
+      <a class="navbar-item" href="{{{or site.url (or siteRootUrl siteRootPath)}}}"><img src="/_/img/james.svg" alt="james logo"> {{site.title}}</a>
+      <button class="navbar-burger" data-target="topbar-nav">
+        <span></span>
+        <span></span>
+        <span></span>
+      </button>
+    </div>
+    <div id="topbar-nav" class="navbar-menu">
+      <div class="navbar-end">
+        <a class="navbar-item" href="#">Home</a>
+        <div class="navbar-item has-dropdown is-hoverable">
+          <a class="navbar-link" href="#">Products</a>
+          <div class="navbar-dropdown">
+            <div class="navbar-item"><strong>James server</strong></div>
+            <a class="navbar-item" href="https://github.com/apache/james-project">Repository</a>
+            <a class="navbar-item" href="https://issues.apache.org/jira/projects/JAMES/issues">Issue Tracker</a>
+            <hr class="navbar-divider">
+            <a class="navbar-item" href="https://james.apache.org/mime4j/index.html">Mime4J</a>
+            <a class="navbar-item" href="https://james.apache.org/jsieve/index.html">jSieve</a>
+            <a class="navbar-item" href="https://james.apache.org/jspf/index.html">jSPF</a>
+            <a class="navbar-item" href="https://james.apache.org/jdkim/index.html">jDKIM</a>
+            <a class="navbar-item" href="https://james.apache.org/hupa/index.html">HUPA</a>
+          </div>
+        </div>
+        <div class="navbar-item has-dropdown is-hoverable">
+          <a class="navbar-link" href="#">Community</a>
+          <div class="navbar-dropdown">
+             <!-- Not ideal but dropping the version in the href requires tweaking james-projet docs module first -->
+            <a class="navbar-item" href="/james-project/3.6.0/community/mailing-lists.html">Mailing lists</a>
+            <a class="navbar-item" href="https://gitter.im/apache/james-project"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" class="logo-gitter-sign" data-v-44ebcb1a=""><rect x="15" y="5" width="2" height="10"></rect> <rect x="10" y="5" width="2" height="20"></rect> <rect x="5" y="5" width="2" height="20"></rect> <rect width="2" height="15"></rect></svg> Gitter</a>
+            <a class="navbar-item" href="https://twitter.com/ApacheJames">
+              <span class="icon">
+                <svg aria-hidden="true" data-icon="twitter" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
+                  <path fill="#57aaee" d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.1 [...]
+                </svg>
+              </span> Twitter
+            </a>            
+            <a class="navbar-item" href="#">  <svg class="octicon octicon-mark-github v-align-middle" viewBox="0 0 16 16" version="1.1" aria-hidden="true"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 [...]
+          </div>
+        </div>
+<!--        <div class="navbar-item">
+          <span class="control">
+            <a class="button is-primary" href="#">Download</a>
+          </span>
+        </div> -->
+      </div>
+    </div>
+  </nav>
+</header>


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org