From ea7da0b4b278d8d7990fe20ea60309a29e7cefc4 Mon Sep 17 00:00:00 2001 From: Thierry Boileau Date: Fri, 30 Oct 2026 14:43:10 +0000 Subject: [PATCH] chore(QTDI-3722): documentation build renders the local checkout - site-template.yml: two content sources. The current checkout is read from the worktree (branches: HEAD) and the released versions come from the tags of the remote repository (branches disabled so the remote default branch is not rendered a second time). - site-dev-template.yml: branches: HEAD instead of master so the checked out branch is rendered, uncommitted changes included. - pom.xml: new doc-dev profile that renders only the current checkout and runs antora:dev in the prepare-package phase. - header-content.hbs: the (dev) label no longer depends on the branch name. - how-to-contribute.adoc: document the two local build modes. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01UmnPc2shKSYfAw7fgrfKrd --- documentation/pom.xml | 30 +++++++++++++++++++ .../modules/ROOT/pages/how-to-contribute.adoc | 19 ++++++++++++ .../src/main/antora/site-dev-template.yml | 4 +-- .../src/main/antora/site-template.yml | 14 +++++++-- .../partials/header-content.hbs | 2 +- 5 files changed, 64 insertions(+), 5 deletions(-) diff --git a/documentation/pom.xml b/documentation/pom.xml index 4b75b1e82a14d..c97f7132dd723 100644 --- a/documentation/pom.xml +++ b/documentation/pom.xml @@ -905,6 +905,36 @@ + + doc-dev + + + dev + + + + + com.github.eirslett + frontend-maven-plugin + + + npm-build + none + + + npm-dev + prepare-package + + + + + + release diff --git a/documentation/src/main/antora/modules/ROOT/pages/how-to-contribute.adoc b/documentation/src/main/antora/modules/ROOT/pages/how-to-contribute.adoc index f76a9c6268b95..ed9a8f52fd379 100644 --- a/documentation/src/main/antora/modules/ROOT/pages/how-to-contribute.adoc +++ b/documentation/src/main/antora/modules/ROOT/pages/how-to-contribute.adoc @@ -15,6 +15,25 @@ There are two ways to suggest modifications or new content. Both of the options * Fork the https://github.com/talend/component-runtime[Runtime] repository of the *Talend Component Kit* project and edit .adoc files located under `documentation\src\main\antora\modules\ROOT\pages`. Make sure to follow the guidelines outlined in the current document, especially for large modifications or new content, to make sure it can properly be rendered. When done, create a pull request that will be assessed by the team in charge of the project. +== Building the documentation locally + +The documentation is built by the `documentation` Maven module. Both modes below render the current state of the branch you have checked out, including uncommitted changes and the pages generated from the source code. + +* Full site, with the released versions of the version dropdown (the released versions are fetched from GitHub, so the network is required): ++ +[source,bash] +---- +mvn clean install -pl documentation +---- +* Fast build of the current version only, without the released versions: ++ +[source,bash] +---- +mvn clean install -pl documentation -Pdoc-dev +---- + +If the other modules of the repository are not installed in your local Maven repository yet, add `-am` to the command. The site is generated in `documentation/target/documentation-`. + == General organization guidelines The documentation is made of: diff --git a/documentation/src/main/antora/site-dev-template.yml b/documentation/src/main/antora/site-dev-template.yml index 092ca0754c066..ff0ab3e774aa7 100644 --- a/documentation/src/main/antora/site-dev-template.yml +++ b/documentation/src/main/antora/site-dev-template.yml @@ -20,9 +20,9 @@ urls: redirect_facility: static content: sources: + # current checkout, read from the worktree (uncommitted changes and freshly generated partials included) - url: ../../../.. - branches: - - master + branches: HEAD start_path: documentation/src/main/antora ui: bundle: diff --git a/documentation/src/main/antora/site-template.yml b/documentation/src/main/antora/site-template.yml index 8768b4064aec4..040c3ea65fd91 100644 --- a/documentation/src/main/antora/site-template.yml +++ b/documentation/src/main/antora/site-template.yml @@ -22,7 +22,19 @@ urls: redirect_facility: static content: sources: + # Current state of this checkout (the version being built). The url is a local path and the branch is the one + # currently checked out, so Antora reads the worktree: uncommitted changes and the partials freshly written by + # the Generator are rendered. In CI this is the exact commit that is being built. + - url: ../../../.. + branches: HEAD + start_path: documentation/src/main/antora + # Already released versions: frozen snapshots read from the tags of the remote repository. + # branches: ~ disables Antora's default branches (HEAD, v*), otherwise the remote default branch would be rendered a + # second time as the current version. worktrees: false so that this source never contributes a worktree either, + # even if the url is changed to a local clone. - url: https://github.com/Talend/component-runtime.git + branches: ~ + worktrees: false tags: # we will keep only latest revision, past revisions will still be present. May speed a bit antora process... - component-runtime-* @@ -198,8 +210,6 @@ content: - '!component-runtime-1.81.0' - '!component-runtime-1.82.0' # - '!component-runtime-1.83.0' - branches: - - HEAD start_path: documentation/src/main/antora ui: bundle: diff --git a/documentation/src/main/antora/supplemental-ui/partials/header-content.hbs b/documentation/src/main/antora/supplemental-ui/partials/header-content.hbs index 61d2aa498a896..6929a88b84cc0 100644 --- a/documentation/src/main/antora/supplemental-ui/partials/header-content.hbs +++ b/documentation/src/main/antora/supplemental-ui/partials/header-content.hbs @@ -38,7 +38,7 @@ {{#if page.component}}