Skip to content

Commit 3b007f9

Browse files
committed
RHIDP-6499 Modularize modules/customizing-the-learning-paths/proc-customize-rhdh-learning-paths.adoc
Signed-off-by: Fabrice Flore-Thébault <[email protected]>
1 parent f5ac51b commit 3b007f9

File tree

5 files changed

+84
-83
lines changed

5 files changed

+84
-83
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[id='proc-customize-rhdh-learning-paths_{context}']
2+
= Customizing the Learning Paths in {product}
3+
4+
In {product}, you can configure Learning Paths by hosting the required data externally,
5+
and using the builtin proxy to deliver this data rather than the default.
6+
7+
You can provide Learning Paths data from the following sources:
8+
9+
* JSON files hosted on a web server, such as GitHub or GitLab.
10+
* A dedicated service that provides the Learning Paths data in JSON format using an API.
11+
12+
include::modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-hosted-json-files.adoc[leveloffset=+1]
13+
14+
15+
include::modules/customizing-the-learning-paths/proc-customizing-the-learning-paths-by-using-a-dedicated-service.adoc[leveloffset=+1]

modules/customizing-the-learning-paths/proc-customize-rhdh-learning-paths.adoc

Lines changed: 0 additions & 82 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[id='proc-customizing-the-learning-paths-by-using-a-customization-service_{context}']
2+
= Customizing the Learning Paths by using a customization service
3+
4+
For advanced scenarios, you can host your {product} customization service to provide data to all configurable {product-short} pages.
5+
You can even use a different service for each page.
6+
7+
.Procedure
8+
. Deploy your {product-short} customization service on the same {ocp-short} cluster as your {product-short} instance.
9+
You can find an example at link:https://github.com/redhat-developer/red-hat-developer-hub-customization-provider[`red-hat-developer-hub-customization-provider`], that provides the same data as default {product-short} data.
10+
The customization service provides a Learning Paths data URL such as: `pass:c[http://rhdh-customization-provider/learning-paths]`.
11+
12+
. Configure the {product-short} proxy to use your dedicated service to provide the Learning Path data, add the following to the link:{configuring-book-url}[`{my-app-config-file}` file]:
13+
+
14+
[source,yaml,subs='+quotes']
15+
----
16+
proxy:
17+
endpoints:
18+
'/developer-hub/learning-paths':
19+
target: _<learning_path_data_url>_
20+
changeOrigin: true
21+
qsecure: true # <1>
22+
----
23+
<1> Change to "false" in case of using self hosted cluster with a self-signed certificate
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
[id='proc-customize-rhdh-learning-paths_{context}']
2+
= Customizing the Learning Paths by using hosted JSON files
3+
4+
For ease of use and simplicity, you can configure the Learning Paths by using hosted JSON files.
5+
6+
7+
.Procedure
8+
. Publish the JSON files containing your Learning Paths data to a web server, such as GitHub or Gitlab. You can find an example at link:https://raw.githubusercontent.com/redhat-developer/rhdh/main/packages/app/public/learning-paths/data.json[].
9+
10+
. Configure the {product-short} proxy to access the Learning Paths data from the hosted JSON files, by adding the following code to the `{my-app-config-file}` file:
11+
+
12+
[source,yaml]
13+
----
14+
proxy:
15+
endpoints:
16+
'/developer-hub':
17+
target: https://raw.githubusercontent.com/
18+
pathRewrite:
19+
'^/api/proxy/developer-hub/learning-paths': '/redhat-developer/rhdh/main/packages/app/public/learning-paths/data.json'
20+
changeOrigin: true
21+
secure: true
22+
----
23+
+
24+
[TIP]
25+
====
26+
When also configuring the home page, due to the use of overlapping `pathRewrites` for both the `learning-path` and `homepage` quick access proxies, create the `learning-paths` configuration (`^api/proxy/developer-hub/learning-paths`) before you create the `homepage` configuration (`^/api/proxy/developer-hub`).
27+
For example:
28+
29+
[source,yaml]
30+
----
31+
proxy:
32+
endpoints:
33+
'/developer-hub':
34+
target: https://raw.githubusercontent.com/
35+
pathRewrite:
36+
'^/api/proxy/developer-hub/learning-paths': '/redhat-developer/rhdh/main/packages/app/public/learning-paths/data.json'
37+
'^/api/proxy/developer-hub/tech-radar': '/redhat-developer/rhdh/main/packages/app/public/tech-radar/data-default.json'
38+
'^/api/proxy/developer-hub': '/redhat-developer/rhdh/main/packages/app/public/homepage/data.json'
39+
changeOrigin: true
40+
secure: true
41+
----
42+
====
43+
44+
.Additional resources
45+
* xref:customizing-the-home-page[Customizing the Home page in {product}].

titles/customizing/master.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ include::modules/customizing/proc-customizing-the-backend-secret.adoc[leveloffse
2020
include::assemblies/assembly-configuring-templates.adoc[leveloffset=+1]
2121

2222

23-
include::modules/customizing-the-learning-paths/proc-customize-rhdh-learning-paths.adoc[leveloffset=+1]
23+
include::assemblies/assembly-customizing-the-learning-paths.adoc[leveloffset=+1]
2424

2525

2626
include::assemblies/assembly-configuring-the-global-header.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)