Skip to content

Commit 86543ba

Browse files
[release-1.6] RHIDP-6499: Modularize Customizing the Learning Paths (#1088)
Co-authored-by: Fabrice Flore-Thébault <[email protected]>
1 parent 54ce202 commit 86543ba

File tree

5 files changed

+88
-83
lines changed

5 files changed

+88
-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 built-in proxy to deliver this data rather than the default.
6+
7+
You can provide Learning Paths data from the following sources:
8+
9+
* A JSON file 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.
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, such as the Learning Paths.
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,a,q[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
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
[id='proc-customizing-the-learning-paths-by-using-a-hosted-json-file_{context}']
2+
= Customizing the Learning Paths by using a hosted JSON file
3+
4+
For ease of use and simplicity, you can configure the Learning Paths by using a hosted JSON file.
5+
6+
.Procedure
7+
. Publish the JSON file 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/release-{product-version}/packages/app/public/learning-paths/data.json[].
8+
9+
. Configure the {product-short} proxy to access the Learning Paths data from the hosted JSON file, by adding the following to the `{my-app-config-file}` file:
10+
+
11+
[source,yaml,subs='+quotes']
12+
----
13+
proxy:
14+
endpoints:
15+
'/developer-hub':
16+
target: _<target>_
17+
pathRewrite:
18+
'^/api/proxy/developer-hub/learning-paths': '_<learning_path.json>_'
19+
changeOrigin: true
20+
secure: true
21+
----
22+
23+
`_<target>_`:: Enter the hosted JSON file base URL, such as `https://raw.githubusercontent.com`.
24+
25+
`_<learning_path.json>_`:: Enter the hosted JSON file path without the base URL, such as
26+
`'/redhat-developer/rhdh/main/packages/app/public/learning-paths/data.json'`
27+
+
28+
[TIP]
29+
====
30+
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`).
31+
For example:
32+
33+
[source,yaml]
34+
----
35+
proxy:
36+
endpoints:
37+
'/developer-hub':
38+
target: https://raw.githubusercontent.com/
39+
pathRewrite:
40+
'^/api/proxy/developer-hub/learning-paths': '/redhat-developer/rhdh/main/packages/app/public/learning-paths/data.json'
41+
'^/api/proxy/developer-hub/tech-radar': '/redhat-developer/rhdh/main/packages/app/public/tech-radar/data-default.json'
42+
'^/api/proxy/developer-hub': '/redhat-developer/rhdh/main/packages/app/public/homepage/data.json'
43+
changeOrigin: true
44+
secure: true
45+
----
46+
====
47+
48+
.Additional resources
49+
* 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)