Skip to content

RHIDP-6499: Modularize Learning Paths docs #1008

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions assemblies/assembly-customizing-learning-paths.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
:_mod-docs-content-type: ASSEMBLY
:context: customizing-learning-paths
[id="{context}"]
= Customizing the Learning Paths in {product}

In {product}, you can configure Learning Paths by passing the data into the `{my-app-config-file}` file as a proxy. The base URL must include the `/developer-hub/learning-paths` proxy.

[NOTE]
====
Due to the use of overlapping `pathRewrites` for both the `learning-path` and `homepage` quick access proxies, you must create the `learning-paths` configuration (`^api/proxy/developer-hub/learning-paths`) before you create the `homepage` configuration (`^/api/proxy/developer-hub`).

For more information about customizing the Home page in {product}, see xref:customizing-the-home-page[Customizing the Home page in {product}].
====

You can provide data to the Learning Path from the following sources:

* JSON files hosted on GitHub or GitLab.
* A dedicated service that provides the Learning Path data in JSON format using an API.

include::modules/customizing-the-learning-paths/proc-customize-rhdh-learning-paths-json-files.adoc[]

include::modules/customizing-the-learning-paths/proc-customize-rhdh-learning-paths-dedicated-service.adoc[]
Original file line number Diff line number Diff line change
@@ -1,46 +1,4 @@
[id='proc-customize-rhdh-learning-paths_{context}']
= Customizing the Learning Paths in {product}

In {product}, you can configure Learning Paths by passing the data into the `{my-app-config-file}` file as a proxy. The base URL must include the `/developer-hub/learning-paths` proxy.

[NOTE]
====
Due to the use of overlapping `pathRewrites` for both the `learning-path` and `homepage` quick access proxies, you must create the `learning-paths` configuration (`^api/proxy/developer-hub/learning-paths`) before you create the `homepage` configuration (`^/api/proxy/developer-hub`).

For more information about customizing the Home page in {product}, see xref:customizing-the-home-page[Customizing the Home page in {product}].
====

You can provide data to the Learning Path from the following sources:

* JSON files hosted on GitHub or GitLab.
* A dedicated service that provides the Learning Path data in JSON format using an API.

== Using hosted JSON files to provide data to the Learning Paths

.Prerequisites

You have installed {product} by using either the Operator or Helm chart.
For more information, see xref:{installing-on-ocp-book-url}#assembly-install-rhdh-ocp[{installing-on-ocp-book-title}].

.Procedure

To access the data from the JSON files, complete the following step:

* Add the following code to the `{my-app-config-file}` file:
+
[source,yaml]
----
proxy:
endpoints:
'/developer-hub':
target: https://raw.githubusercontent.com/
pathRewrite:
'^/api/proxy/developer-hub/learning-paths': '/redhat-developer/rhdh/main/packages/app/public/learning-paths/data.json'
'^/api/proxy/developer-hub/tech-radar': '/redhat-developer/rhdh/main/packages/app/public/tech-radar/data-default.json'
'^/api/proxy/developer-hub': '/redhat-developer/rhdh/main/packages/app/public/homepage/data.json'
changeOrigin: true
secure: true
----
[id='proc-customize-rhdh-learning-paths-dedicated-service_{context}']

== Using a dedicated service to provide data to the Learning Paths
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
== Using a dedicated service to provide data to the Learning Paths
= Using a dedicated service to provide data to the Learning Paths


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[id='proc-customize-rhdh-learning-paths-json-files_{context}']

== Using hosted JSON files to provide data to the Learning Paths
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
== Using hosted JSON files to provide data to the Learning Paths
= Using hosted JSON files to provide data to the Learning Paths


.Prerequisites

You have installed {product} by using either the Operator or Helm chart.
For more information, see xref:{installing-on-ocp-book-url}#assembly-install-rhdh-ocp[{installing-on-ocp-book-title}].

.Procedure

To access the data from the JSON files, complete the following step:

* Add the following code to the `{my-app-config-file}` file:
+
[source,yaml]
----
proxy:
endpoints:
'/developer-hub':
target: https://raw.githubusercontent.com/
pathRewrite:
'^/api/proxy/developer-hub/learning-paths': '/redhat-developer/rhdh/main/packages/app/public/learning-paths/data.json'
'^/api/proxy/developer-hub/tech-radar': '/redhat-developer/rhdh/main/packages/app/public/tech-radar/data-default.json'
'^/api/proxy/developer-hub': '/redhat-developer/rhdh/main/packages/app/public/homepage/data.json'
changeOrigin: true
secure: true
----
2 changes: 1 addition & 1 deletion titles/customizing/master.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ include::modules/customizing/proc-customizing-the-backend-secret.adoc[leveloffse
include::assemblies/assembly-configuring-templates.adoc[leveloffset=+1]


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


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