diff --git a/documentation/pom.xml b/documentation/pom.xml
index 98987f9d84728..21fb112a461e8 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 fcc2a1d917045..03e8db5b36042 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-*
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}}